<!DOCTYPE html><html><head>
      <title>README</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      
      <link rel="stylesheet" href="file:///d:\Users\Administrator\Desktop\大学\VSCode\data\extensions\shd101wyy.markdown-preview-enhanced-0.8.8\crossnote\dependencies\katex\katex.min.css">
      
      
      
      
      
      <style>
      code[class*=language-],pre[class*=language-]{color:#333;background:0 0;font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.4;-moz-tab-size:8;-o-tab-size:8;tab-size:8;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:.8em;overflow:auto;border-radius:3px;background:#f5f5f5}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal;background:#f5f5f5}.token.blockquote,.token.comment{color:#969896}.token.cdata{color:#183691}.token.doctype,.token.macro.property,.token.punctuation,.token.variable{color:#333}.token.builtin,.token.important,.token.keyword,.token.operator,.token.rule{color:#a71d5d}.token.attr-value,.token.regex,.token.string,.token.url{color:#183691}.token.atrule,.token.boolean,.token.code,.token.command,.token.constant,.token.entity,.token.number,.token.property,.token.symbol{color:#0086b3}.token.prolog,.token.selector,.token.tag{color:#63a35c}.token.attr-name,.token.class,.token.class-name,.token.function,.token.id,.token.namespace,.token.pseudo-class,.token.pseudo-element,.token.url-reference .token.variable{color:#795da3}.token.entity{cursor:help}.token.title,.token.title .token.punctuation{font-weight:700;color:#1d3e81}.token.list{color:#ed6a43}.token.inserted{background-color:#eaffea;color:#55a532}.token.deleted{background-color:#ffecec;color:#bd2c00}.token.bold{font-weight:700}.token.italic{font-style:italic}.language-json .token.property{color:#183691}.language-markup .token.tag .token.punctuation{color:#333}.language-css .token.function,code.language-css{color:#0086b3}.language-yaml .token.atrule{color:#63a35c}code.language-yaml{color:#183691}.language-ruby .token.function{color:#333}.language-markdown .token.url{color:#795da3}.language-makefile .token.symbol{color:#795da3}.language-makefile .token.variable{color:#183691}.language-makefile .token.builtin{color:#0086b3}.language-bash .token.keyword{color:#0086b3}pre[data-line]{position:relative;padding:1em 0 1em 3em}pre[data-line] .line-highlight-wrapper{position:absolute;top:0;left:0;background-color:transparent;display:block;width:100%}pre[data-line] .line-highlight{position:absolute;left:0;right:0;padding:inherit 0;margin-top:1em;background:hsla(24,20%,50%,.08);background:linear-gradient(to right,hsla(24,20%,50%,.1) 70%,hsla(24,20%,50%,0));pointer-events:none;line-height:inherit;white-space:pre}pre[data-line] .line-highlight:before,pre[data-line] .line-highlight[data-end]:after{content:attr(data-start);position:absolute;top:.4em;left:.6em;min-width:1em;padding:0 .5em;background-color:hsla(24,20%,50%,.4);color:#f4f1ef;font:bold 65%/1.5 sans-serif;text-align:center;vertical-align:.3em;border-radius:999px;text-shadow:none;box-shadow:0 1px #fff}pre[data-line] .line-highlight[data-end]:after{content:attr(data-end);top:auto;bottom:.4em}html body{font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff;overflow:initial;box-sizing:border-box;word-wrap:break-word}html body>:first-child{margin-top:0}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{line-height:1.2;margin-top:1em;margin-bottom:16px;color:#000}html body h1{font-size:2.25em;font-weight:300;padding-bottom:.3em}html body h2{font-size:1.75em;font-weight:400;padding-bottom:.3em}html body h3{font-size:1.5em;font-weight:500}html body h4{font-size:1.25em;font-weight:600}html body h5{font-size:1.1em;font-weight:600}html body h6{font-size:1em;font-weight:600}html body h1,html body h2,html body h3,html body h4,html body h5{font-weight:600}html body h5{font-size:1em}html body h6{color:#5c5c5c}html body strong{color:#000}html body del{color:#5c5c5c}html body a:not([href]){color:inherit;text-decoration:none}html body a{color:#08c;text-decoration:none}html body a:hover{color:#00a3f5;text-decoration:none}html body img{max-width:100%}html body>p{margin-top:0;margin-bottom:16px;word-wrap:break-word}html body>ol,html body>ul{margin-bottom:16px}html body ol,html body ul{padding-left:2em}html body ol.no-list,html body ul.no-list{padding:0;list-style-type:none}html body ol ol,html body ol ul,html body ul ol,html body ul ul{margin-top:0;margin-bottom:0}html body li{margin-bottom:0}html body li.task-list-item{list-style:none}html body li>p{margin-top:0;margin-bottom:0}html body .task-list-item-checkbox{margin:0 .2em .25em -1.8em;vertical-align:middle}html body .task-list-item-checkbox:hover{cursor:pointer}html body blockquote{margin:16px 0;font-size:inherit;padding:0 15px;color:#5c5c5c;background-color:#f0f0f0;border-left:4px solid #d6d6d6}html body blockquote>:first-child{margin-top:0}html body blockquote>:last-child{margin-bottom:0}html body hr{height:4px;margin:32px 0;background-color:#d6d6d6;border:0 none}html body table{margin:10px 0 15px 0;border-collapse:collapse;border-spacing:0;display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}html body table th{font-weight:700;color:#000}html body table td,html body table th{border:1px solid #d6d6d6;padding:6px 13px}html body dl{padding:0}html body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:700}html body dl dd{padding:0 16px;margin-bottom:16px}html body code{font-family:Menlo,Monaco,Consolas,'Courier New',monospace;font-size:.85em;color:#000;background-color:#f0f0f0;border-radius:3px;padding:.2em 0}html body code::after,html body code::before{letter-spacing:-.2em;content:'\00a0'}html body pre>code{padding:0;margin:0;word-break:normal;white-space:pre;background:0 0;border:0}html body .highlight{margin-bottom:16px}html body .highlight pre,html body pre{padding:1em;overflow:auto;line-height:1.45;border:#d6d6d6;border-radius:3px}html body .highlight pre{margin-bottom:0;word-break:normal}html body pre code,html body pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}html body pre code:after,html body pre code:before,html body pre tt:after,html body pre tt:before{content:normal}html body blockquote,html body dl,html body ol,html body p,html body pre,html body ul{margin-top:0;margin-bottom:16px}html body kbd{color:#000;border:1px solid #d6d6d6;border-bottom:2px solid #c7c7c7;padding:2px 4px;background-color:#f0f0f0;border-radius:3px}@media print{html body{background-color:#fff}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{color:#000;page-break-after:avoid}html body blockquote{color:#5c5c5c}html body pre{page-break-inside:avoid}html body table{display:table}html body img{display:block;max-width:100%;max-height:100%}html body code,html body pre{word-wrap:break-word;white-space:pre}}.markdown-preview{width:100%;height:100%;box-sizing:border-box}.markdown-preview ul{list-style:disc}.markdown-preview ul ul{list-style:circle}.markdown-preview ul ul ul{list-style:square}.markdown-preview ol{list-style:decimal}.markdown-preview ol ol,.markdown-preview ul ol{list-style-type:lower-roman}.markdown-preview ol ol ol,.markdown-preview ol ul ol,.markdown-preview ul ol ol,.markdown-preview ul ul ol{list-style-type:lower-alpha}.markdown-preview .newpage,.markdown-preview .pagebreak{page-break-before:always}.markdown-preview pre.line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}.markdown-preview pre.line-numbers>code{position:relative}.markdown-preview pre.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:1em;font-size:100%;left:0;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.markdown-preview pre.line-numbers .line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.markdown-preview pre.line-numbers .line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}.markdown-preview .mathjax-exps .MathJax_Display{text-align:center!important}.markdown-preview:not([data-for=preview]) .code-chunk .code-chunk-btn-group{display:none}.markdown-preview:not([data-for=preview]) .code-chunk .status{display:none}.markdown-preview:not([data-for=preview]) .code-chunk .output-div{margin-bottom:16px}.markdown-preview .md-toc{padding:0}.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link{display:inline;padding:.25rem 0}.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link div,.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link p{display:inline}.markdown-preview .md-toc .md-toc-link-wrapper.highlighted .md-toc-link{font-weight:800}.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}html body[for=html-export]:not([data-presentation-mode]){position:relative;width:100%;height:100%;top:0;left:0;margin:0;padding:0;overflow:auto}html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{position:relative;top:0;min-height:100vh}@media screen and (min-width:914px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{padding:2em calc(50% - 457px + 2em)}}@media screen and (max-width:914px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{font-size:14px!important;padding:1em}}@media print{html body[for=html-export]:not([data-presentation-mode]) #sidebar-toc-btn{display:none}}html body[for=html-export]:not([data-presentation-mode]) #sidebar-toc-btn{position:fixed;bottom:8px;left:8px;font-size:28px;cursor:pointer;color:inherit;z-index:99;width:32px;text-align:center;opacity:.4}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] #sidebar-toc-btn{opacity:1}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc{position:fixed;top:0;left:0;width:300px;height:100%;padding:32px 0 48px 0;font-size:14px;box-shadow:0 0 4px rgba(150,150,150,.33);box-sizing:border-box;overflow:auto;background-color:inherit}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar{width:8px}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc a{text-decoration:none}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc{padding:0 16px}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link{display:inline;padding:.25rem 0}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link div,html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link p{display:inline}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper.highlighted .md-toc-link{font-weight:800}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{left:300px;width:calc(100% - 300px);padding:2em calc(50% - 457px - 300px / 2);margin:0;box-sizing:border-box}@media screen and (max-width:1274px){html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{width:100%}}html body[for=html-export]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .markdown-preview{left:50%;transform:translateX(-50%)}html body[for=html-export]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .md-sidebar-toc{display:none}
/* Please visit the URL below for more information: */
/*   https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */

      </style>
      <!-- The content below will be included at the end of the <head> element. --><script type="text/javascript">
  document.addEventListener("DOMContentLoaded", function () {
    // your code here
  });
</script></head><body for="html-export">
    
    
      <div class="crossnote markdown-preview  ">
      
<h2 id="薪水支付系统">薪水支付系统 </h2>
<h2 id="1问题描述">1.问题描述 </h2>
<p>下面是薪水支付系统的需求描述（与ASD相比进行了简化）：<br>
（1）有些雇员完全以月薪进行支付。在他们的雇员记录中有一个月薪字段。<br>
（2）有些雇员是钟点工。按照他们雇员记录中每小时报酬数和他们的工作时间支付薪水。他们每天会提交工作时间卡，其中记录了日期和工作小时数。如果他们每天工作超过8小时，那么超过的部分会按照正常报酬的1.5倍支付薪水。<br>
（3）对于一些带薪雇员，会根据他们的销售情况，支付一定数量的酬金。他们会提交销售凭条，其中记录了日期和销售金额。在他们的雇员记录中有一个酬金报酬字段。<br>
（4）雇员可以选择支付方式。可以选择把支付支票邮寄到他们指定的邮政地址；也可以把支票保存在出纳人员那里随时支取；或者要求将薪水直接存入他们指定的银行账户。<br>
（5）薪水支付程序于每月发薪日运行一次，为相应的雇员支付薪水。</p>
<h2 id="2需求分析">2.需求分析 </h2>
<p class="plantuml"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" data-diagram-type="DESCRIPTION" height="393px" preserveAspectRatio="none" style="width:501px;height:393px;background:#FFFFFF;" version="1.1" viewBox="0 0 501 393" width="501px" zoomAndPan="magnify"><defs></defs><g><!--entity u--><g class="entity" data-entity="u" data-source-line="2" data-uid="ent0002" id="entity_u"><ellipse cx="67.5151" cy="182.87" fill="#F1F1F1" rx="8" ry="8" style="stroke:#181818;stroke-width:0.5;"></ellipse><path d="M67.5151,190.87 L67.5151,217.87 M54.5151,198.87 L80.5151,198.87 M67.5151,217.87 L54.5151,232.87 M67.5151,217.87 L80.5151,232.87" fill="none" style="stroke:#181818;stroke-width:0.5;"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="31.9102" x="51.56" y="247.3651">User</text></g><!--entity uc1--><g class="entity" data-entity="uc1" data-source-line="4" data-uid="ent0003" id="entity_uc1"><ellipse cx="250.5378" cy="52.5236" fill="#F1F1F1" rx="42.5978" ry="14.5236" style="stroke:#181818;stroke-width:0.5;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="55.9998" x="222.5379" y="57.1721">添加雇员</text></g><!--entity uc11--><g class="entity" data-entity="uc11" data-source-line="5" data-uid="ent0004" id="entity_uc11"><ellipse cx="433.5673" cy="20.5236" fill="#F1F1F1" rx="52.4973" ry="14.5236" style="stroke:#181818;stroke-width:0.5;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="69.9997" x="398.5674" y="25.1721">添加钟点工</text></g><!--entity uc12--><g class="entity" data-entity="uc12" data-source-line="6" data-uid="ent0005" id="entity_uc12"><ellipse cx="433.5742" cy="84.5228" fill="#F1F1F1" rx="61.5142" ry="14.7028" style="stroke:#181818;stroke-width:0.5;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="83.9996" x="391.5744" y="89.1713">添加月薪雇员</text></g><!--entity uc13--><g class="entity" data-entity="uc13" data-source-line="7" data-uid="ent0006" id="entity_uc13"><ellipse cx="67.5142" cy="124.5228" fill="#F1F1F1" rx="61.5142" ry="14.7028" style="stroke:#181818;stroke-width:0.5;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="83.9996" x="25.5144" y="129.1713">添加销售经理</text></g><!--entity uc2--><g class="entity" data-entity="uc2" data-source-line="8" data-uid="ent0007" id="entity_uc2"><ellipse cx="250.5378" cy="116.5236" fill="#F1F1F1" rx="42.5978" ry="14.5236" style="stroke:#181818;stroke-width:0.5;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="55.9998" x="222.5379" y="121.1721">删除雇员</text></g><!--entity uc3--><g class="entity" data-entity="uc3" data-source-line="9" data-uid="ent0008" id="entity_uc3"><ellipse cx="250.5373" cy="180.5236" fill="#F1F1F1" rx="52.4973" ry="14.5236" style="stroke:#181818;stroke-width:0.5;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="69.9997" x="215.5374" y="185.1721">登记时间卡</text></g><!--entity uc4--><g class="entity" data-entity="uc4" data-source-line="10" data-uid="ent0009" id="entity_uc4"><ellipse cx="250.5442" cy="244.5228" fill="#F1F1F1" rx="61.5142" ry="14.7028" style="stroke:#181818;stroke-width:0.5;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="83.9996" x="208.5444" y="249.1713">登记销售凭条</text></g><!--entity uc5--><g class="entity" data-entity="uc5" data-source-line="11" data-uid="ent0010" id="entity_uc5"><ellipse cx="250.5442" cy="308.5228" fill="#F1F1F1" rx="61.5142" ry="14.7028" style="stroke:#181818;stroke-width:0.5;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="83.9996" x="208.5444" y="313.1713">更改雇员明细</text></g><!--entity uc6--><g class="entity" data-entity="uc6" data-source-line="12" data-uid="ent0011" id="entity_uc6"><ellipse cx="250.5384" cy="372.5236" fill="#F1F1F1" rx="32.6984" ry="14.5236" style="stroke:#181818;stroke-width:0.5;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="41.9998" x="229.5384" y="377.1721">发薪日</text></g><!--link u to uc1--><g class="link" data-entity-1="u" data-entity-2="uc1" data-source-line="13" data-uid="lnk12" id="link_u_uc1"><path d="M83.95,199.23 C96.5,188.2 114.44,171.88 129.03,156.52 C157.71,126.31 156.67,110.75 189.03,84.52 C199.18,76.28 206.3836,71.8427 217.4536,66.4627" fill="none" id="u-to-uc1" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="222.85,63.84,213.0069,64.1764,218.353,66.0256,216.5038,71.3716,222.85,63.84" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link u to uc2--><g class="link" data-entity-1="u" data-entity-2="uc2" data-source-line="14" data-uid="lnk13" id="link_u_uc2"><path d="M83.73,204.43 C106.58,192.27 151.14,168.59 189.03,148.52 C201.31,142.01 209.7042,137.5615 220.9542,131.6215" fill="none" id="u-to-uc2" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="226.26,128.82,216.4336,129.485,221.8385,131.1546,220.1689,136.5594,226.26,128.82" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link u to uc3--><g class="link" data-entity-1="u" data-entity-2="uc3" data-source-line="15" data-uid="lnk14" id="link_u_uc3"><path d="M83.95,209.79 C110.54,205.09 160.0118,196.3455 199.4018,189.3755" fill="none" id="u-to-uc3" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="205.31,188.33,195.7507,185.9594,200.3865,189.2012,197.1446,193.837,205.31,188.33" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link u to uc4--><g class="link" data-entity-1="u" data-entity-2="uc4" data-source-line="16" data-uid="lnk15" id="link_u_uc4"><path d="M83.95,215.24 C109.43,219.75 155.4315,227.8863 194.3815,234.7663" fill="none" id="u-to-uc4" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="200.29,235.81,192.123,230.3055,195.3662,234.9403,190.7314,238.1835,200.29,235.81" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link u to uc5--><g class="link" data-entity-1="u" data-entity-2="uc5" data-source-line="17" data-uid="lnk16" id="link_u_uc5"><path d="M83.73,220.61 C106.58,232.76 151.14,256.44 189.03,276.52 C200.37,282.53 207.6052,286.3565 218.3152,292.0165" fill="none" id="u-to-uc5" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="223.62,294.82,217.5318,287.0783,219.1994,292.4838,213.7939,294.1513,223.62,294.82" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link u to uc6--><g class="link" data-entity-1="u" data-entity-2="uc6" data-source-line="18" data-uid="lnk17" id="link_u_uc6"><path d="M83.95,232.67 C105.36,259.67 146.3,307.97 189.03,340.52 C200.47,349.23 209.1963,354.2731 220.9363,359.8831" fill="none" id="u-to-uc6" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="226.35,362.47,219.9541,354.9805,221.8386,360.3142,216.5049,362.1987,226.35,362.47" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link uc1 to uc11--><g class="link" data-entity-1="uc1" data-entity-2="uc11" data-source-line="20" data-uid="lnk18" id="link_uc1_uc11"><path d="M289.05,45.89 C317.95,40.78 352.0616,34.7443 382.5016,29.3643" fill="none" id="uc1-to-uc11" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="388.41,28.32,378.8512,25.9474,383.4863,29.1902,380.2435,33.8253,388.41,28.32" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link uc1 to uc12--><g class="link" data-entity-1="uc1" data-entity-2="uc12" data-source-line="21" data-uid="lnk19" id="link_uc1_uc12"><path d="M289.05,59.15 C316.29,63.96 347.5018,69.4746 377.1718,74.7246" fill="none" id="uc1-to-uc12" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="383.08,75.77,374.9146,70.263,378.1565,74.8988,373.5207,78.1407,383.08,75.77" style="stroke:#181818;stroke-width:1;"></polygon></g><!--SRC=[oqbDAr4eoLSeoapFA558oInAJIx9pC_ZIamkoIzI22rEBL98B5OevU8gBKvDJYnELL1wjdttqwu5BsUtFvquGmaicMo88Jjf_lEcdK-tBmKh0Ad0KF9iJiUBQQkGZ06fCi8mQ4h3qodhdk_kVpwX3QxA6A7gQSU2bpENe3W6oOpdCtU_MBVXsVHjBwTlUTgx4Ah065q1n9AdxMkVpLse15PYee3aaDbRdatP2R7YsOo-vxlReEQO8YbwsZyHw9jdqvT2vSouIXLqTUqWOGDb6S5Pnd2M2Pnb2cUP0GCxsH2ctH2POmG0]--></g></svg></p><h2 id="用例1增加雇员">用例1：增加雇员 </h2>
<p>使用AddEmp操作(transaction)增加新雇员。该操作包含有分配的雇员号、雇员的名字及其地址。该操作有3种形式：<br>
AddEmp EmpId “name” “address” H hourly-rate<br>
AddEmp EmpId “name" “address” S monthly-salary<br>
AddEmp EmpId “name” “address” C monthly-salary<br>
commosion-rate<br>
雇员记录是根据对应字段的值来创建的。<br>
异常情况1：描述操作的结构有错误。<br>
如果描述操作的结构不正确，会打印一条错误消息，不进行任何处理。</p>
<h2 id="用例2--删除雇员">用例2  删除雇员。 </h2>
<p>使用DelEmp操作来删除雇员。操作形式：<br>
DelEmp EmpId<br>
当执行该操作时，会删除对应的雇员记录。<br>
异常情况1：无效或者未知的EmpId。<br>
如果EmpId字段不具有正确的结构，或者它没有引用到一条有效的雇员记录，会打印一条错误消息，不进行其他处理。</p>
<h2 id="用例3--登记时间卡">用例3  登记时间卡。 </h2>
<p>执行TimeCard操作时，系统会创建一条时间卡记录，并把该记录和对应的雇员记录关联起来。<br>
TimeCard EmpId date hours<br>
异常情况1：所选择的雇员不是钟点雇员。<br>
系统会打印一条错误信息，并且不进行进一步的处理。<br>
异常情况2：描述操作的结构中有错误。<br>
系统会打印一条错误信息，不进行进一步的处理。</p>
<h2 id="用例4--登记销售凭条">用例4  登记销售凭条。 </h2>
<p>执行SalesReceipt操作时，系统会创建一条新的销售凭条记录，并把该记录和相应的应支付酬金的雇员关联起来。<br>
SalesReceipt EmpId date amount<br>
异常情况1：所选择的雇员不是应该支付酬金的。<br>
系统会打印一条错误消息，不进行进一步的处理。<br>
异常情况2：描述操作的结构中有错误。<br>
系统会打印一条错误信息，不进行进一步的处理。</p>
<h2 id="用例5--更改雇员明细">用例5  更改雇员明细。 </h2>
<p>执行ChgEmp操作时，系统会更改对应雇员记录的详细信息之一。该操的几种操作形式如下：<br>
ChgEmp EmpId name “name”	更改雇员名<br>
ChgEmp EmpId address “address”	更改雇员地址<br>
ChgEmp EmpId hourly hourly-rate	更改每小时报酬<br>
ChgEmp EmpId salaried salary	更改薪水<br>
ChgEmp EmpId commissioned salary rate	更改酬金<br>
ChgEmp EmpId hold	持有支票<br>
ChgEmp EmpId direct “bank” “account”	直接存款<br>
ChgEmp EmpId mail “address”	邮寄支票<br>
异常情况：操作错误。<br>
如果描述操作的结构不正确，或者EmpId没有引用到真正的雇员，那么打印一条错误信息，不进行进一步的处理。</p>
<h2 id="用例6--发薪日">用例6  发薪日。 </h2>
<p>执行Payday操作时，系统计算所有雇员的薪金，并根据他们所选择的支付方式对他们进行支付。<br>
Payday</p>
<h2 id="系统设计">系统设计 </h2>
<p class="plantuml"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" data-diagram-type="CLASS" height="555px" preserveAspectRatio="none" style="width:1681px;height:555px;background:#FFFFFF;" version="1.1" viewBox="0 0 1681 555" width="1681px" zoomAndPan="magnify"><defs></defs><g><!--class PaymentClassfication--><g class="entity" data-entity="PaymentClassfication" data-source-line="1" data-uid="ent0002" id="entity_PaymentClassfication"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="182.6641" x="7" y="104.78"></rect><ellipse cx="22" cy="120.78" fill="#A9DCDF" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M22.1094,116.1237 L20.9531,121.2019 L23.2813,121.2019 L22.1094,116.1237 Z M20.625,113.8894 L23.6094,113.8894 L26.9688,126.28 L24.5156,126.28 L23.75,123.2175 L20.4688,123.2175 L19.7188,126.28 L17.2813,126.28 L20.625,113.8894 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="150.6641" x="36" y="125.6267">PaymentClassfication</text><line style="stroke:#181818;stroke-width:0.5;" x1="8" x2="188.6641" y1="136.78" y2="136.78"></line><line style="stroke:#181818;stroke-width:0.5;" x1="8" x2="188.6641" y1="144.78" y2="144.78"></line></g><!--class PaymentMethod--><g class="entity" data-entity="PaymentMethod" data-source-line="2" data-uid="ent0003" id="entity_PaymentMethod"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="146.4268" x="601.12" y="104.78"></rect><ellipse cx="616.12" cy="120.78" fill="#A9DCDF" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M616.2294,116.1237 L615.0731,121.2019 L617.4013,121.2019 L616.2294,116.1237 Z M614.745,113.8894 L617.7294,113.8894 L621.0888,126.28 L618.6356,126.28 L617.87,123.2175 L614.5888,123.2175 L613.8388,126.28 L611.4013,126.28 L614.745,113.8894 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="114.4268" x="630.12" y="125.6267">PaymentMethod</text><line style="stroke:#181818;stroke-width:0.5;" x1="602.12" x2="746.5468" y1="136.78" y2="136.78"></line><line style="stroke:#181818;stroke-width:0.5;" x1="602.12" x2="746.5468" y1="144.78" y2="144.78"></line></g><!--class Employee--><g class="entity" data-entity="Employee" data-source-line="4" data-uid="ent0004" id="entity_Employee"><rect fill="#F1F1F1" height="243.5625" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="341.3896" x="224.64" y="7"></rect><ellipse cx="356.4164" cy="23" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M359.3851,28.6406 Q358.807,28.9375 358.1664,29.0781 Q357.5257,29.2344 356.8226,29.2344 Q354.3226,29.2344 352.9945,27.5938 Q351.682,25.9375 351.682,22.8125 Q351.682,19.6875 352.9945,18.0313 Q354.3226,16.375 356.8226,16.375 Q357.5257,16.375 358.1664,16.5313 Q358.8226,16.6875 359.3851,16.9844 L359.3851,19.7031 Q358.7601,19.125 358.1664,18.8594 Q357.5726,18.5781 356.9476,18.5781 Q355.6039,18.5781 354.9164,19.6563 Q354.2289,20.7188 354.2289,22.8125 Q354.2289,24.9063 354.9164,25.9844 Q355.6039,27.0469 356.9476,27.0469 Q357.5726,27.0469 358.1664,26.7813 Q358.7601,26.5 359.3851,25.9219 L359.3851,28.6406 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="69.3369" x="376.9164" y="27.8467">Employee</text><line style="stroke:#181818;stroke-width:0.5;" x1="225.64" x2="565.0296" y1="39" y2="39"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="232.64" y="49.6484"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="76.0225" x="244.64" y="55.9951">empId : int</text><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="232.64" y="65.9453"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="95.1016" x="244.64" y="72.292">name : String</text><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="232.64" y="82.2422"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="110.708" x="244.64" y="88.5889">address : String</text><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="232.64" y="98.5391"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="315.3896" x="244.64" y="104.8857">paymentClassfication : PaymentClassfication</text><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="232.64" y="114.8359"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="242.915" x="244.64" y="121.1826">paymentMethod : PaymentMethod</text><line style="stroke:#181818;stroke-width:0.5;" x1="225.64" x2="565.0296" y1="128.4844" y2="128.4844"></line><ellipse cx="235.64" cy="142.1328" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="228.3271" x="244.64" y="145.4795">Employee(empId,name,address)</text><ellipse cx="235.64" cy="158.4297" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="78.2988" x="244.64" y="161.7764">getEmpId()</text><ellipse cx="235.64" cy="174.7266" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="75.2158" x="244.64" y="178.0732">getName()</text><ellipse cx="235.64" cy="191.0234" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="188.4668" x="244.64" y="194.3701">getPaymentClassification()</text><ellipse cx="235.64" cy="207.3203" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="186.874" x="244.64" y="210.667">setPaymentClassification()</text><ellipse cx="235.64" cy="223.6172" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="148.3398" x="244.64" y="226.9639">getPaymentMethod()</text><ellipse cx="235.64" cy="239.9141" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="146.7471" x="244.64" y="243.2607">setPaymentMethod()</text></g><!--class HourlyClassification--><g class="entity" data-entity="HourlyClassification" data-source-line="23" data-uid="ent0007" id="entity_HourlyClassification"><rect fill="#F1F1F1" height="96.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="252.1055" x="942.28" y="310.57"></rect><ellipse cx="994.8176" cy="326.57" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M997.7863,332.2106 Q997.2082,332.5075 996.5676,332.6481 Q995.927,332.8044 995.2238,332.8044 Q992.7238,332.8044 991.3957,331.1637 Q990.0832,329.5075 990.0832,326.3825 Q990.0832,323.2575 991.3957,321.6012 Q992.7238,319.945 995.2238,319.945 Q995.927,319.945 996.5676,320.1012 Q997.2238,320.2575 997.7863,320.5544 L997.7863,323.2731 Q997.1613,322.695 996.5676,322.4294 Q995.9738,322.1481 995.3488,322.1481 Q994.0051,322.1481 993.3176,323.2262 Q992.6301,324.2887 992.6301,326.3825 Q992.6301,328.4762 993.3176,329.5544 Q994.0051,330.6169 995.3488,330.6169 Q995.9738,330.6169 996.5676,330.3512 Q997.1613,330.07 997.7863,329.4919 L997.7863,332.2106 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="138.5303" x="1015.3176" y="331.4167">HourlyClassification</text><line style="stroke:#181818;stroke-width:0.5;" x1="943.28" x2="1193.3855" y1="342.57" y2="342.57"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="950.28" y="353.2184"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="133.5332" x="962.28" y="359.5651">hourlyRate: double</text><line style="stroke:#181818;stroke-width:0.5;" x1="943.28" x2="1193.3855" y1="366.8669" y2="366.8669"></line><ellipse cx="953.28" cy="380.5153" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="226.1055" x="962.28" y="383.862">HourlyClassification(hourlyRate)</text><ellipse cx="953.28" cy="396.8122" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="112.2188" x="962.28" y="400.1589">getHourlyRate()</text></g><!--class PaymentClassification--><g class="entity" data-entity="PaymentClassification" data-source-line="24" data-uid="ent0008" id="entity_PaymentClassification"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="186.5537" x="1227.06" y="104.78"></rect><ellipse cx="1242.06" cy="120.78" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M1245.0288,126.4206 Q1244.4506,126.7175 1243.81,126.8581 Q1243.1694,127.0144 1242.4663,127.0144 Q1239.9663,127.0144 1238.6381,125.3737 Q1237.3256,123.7175 1237.3256,120.5925 Q1237.3256,117.4675 1238.6381,115.8112 Q1239.9663,114.155 1242.4663,114.155 Q1243.1694,114.155 1243.81,114.3112 Q1244.4663,114.4675 1245.0288,114.7644 L1245.0288,117.4831 Q1244.4038,116.905 1243.81,116.6394 Q1243.2163,116.3581 1242.5913,116.3581 Q1241.2475,116.3581 1240.56,117.4362 Q1239.8725,118.4987 1239.8725,120.5925 Q1239.8725,122.6862 1240.56,123.7644 Q1241.2475,124.8269 1242.5913,124.8269 Q1243.2163,124.8269 1243.81,124.5612 Q1244.4038,124.28 1245.0288,123.7019 L1245.0288,126.4206 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="154.5537" x="1256.06" y="125.6267">PaymentClassification</text><line style="stroke:#181818;stroke-width:0.5;" x1="1228.06" x2="1412.6137" y1="136.78" y2="136.78"></line><line style="stroke:#181818;stroke-width:0.5;" x1="1228.06" x2="1412.6137" y1="144.78" y2="144.78"></line></g><!--class SalariedClassification--><g class="entity" data-entity="SalariedClassification" data-source-line="28" data-uid="ent0010" id="entity_SalariedClassification"><rect fill="#F1F1F1" height="64.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="181.7139" x="1229.48" y="326.86"></rect><ellipse cx="1244.48" cy="342.86" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M1247.4488,348.5006 Q1246.8706,348.7975 1246.23,348.9381 Q1245.5894,349.0944 1244.8863,349.0944 Q1242.3863,349.0944 1241.0581,347.4537 Q1239.7456,345.7975 1239.7456,342.6725 Q1239.7456,339.5475 1241.0581,337.8912 Q1242.3863,336.235 1244.8863,336.235 Q1245.5894,336.235 1246.23,336.3912 Q1246.8863,336.5475 1247.4488,336.8444 L1247.4488,339.5631 Q1246.8238,338.985 1246.23,338.7194 Q1245.6363,338.4381 1245.0113,338.4381 Q1243.6675,338.4381 1242.98,339.5162 Q1242.2925,340.5787 1242.2925,342.6725 Q1242.2925,344.7662 1242.98,345.8444 Q1243.6675,346.9069 1245.0113,346.9069 Q1245.6363,346.9069 1246.23,346.6412 Q1246.8238,346.36 1247.4488,345.7819 L1247.4488,348.5006 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="149.7139" x="1258.48" y="347.7067">SalariedClassification</text><line style="stroke:#181818;stroke-width:0.5;" x1="1230.48" x2="1410.1939" y1="358.86" y2="358.86"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="1237.48" y="369.5084"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="99.2646" x="1249.48" y="375.8551">salary: double</text><line style="stroke:#181818;stroke-width:0.5;" x1="1230.48" x2="1410.1939" y1="383.1569" y2="383.1569"></line></g><!--class CommissionedClassification--><g class="entity" data-entity="CommissionedClassification" data-source-line="31" data-uid="ent0012" id="entity_CommissionedClassification"><rect fill="#F1F1F1" height="80.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="227.5557" x="1446.55" y="318.71"></rect><ellipse cx="1461.55" cy="334.71" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M1464.5188,340.3506 Q1463.9406,340.6475 1463.3,340.7881 Q1462.6594,340.9444 1461.9563,340.9444 Q1459.4563,340.9444 1458.1281,339.3037 Q1456.8156,337.6475 1456.8156,334.5225 Q1456.8156,331.3975 1458.1281,329.7412 Q1459.4563,328.085 1461.9563,328.085 Q1462.6594,328.085 1463.3,328.2412 Q1463.9563,328.3975 1464.5188,328.6944 L1464.5188,331.4131 Q1463.8938,330.835 1463.3,330.5694 Q1462.7063,330.2881 1462.0813,330.2881 Q1460.7375,330.2881 1460.05,331.3662 Q1459.3625,332.4287 1459.3625,334.5225 Q1459.3625,336.6162 1460.05,337.6944 Q1460.7375,338.7569 1462.0813,338.7569 Q1462.7063,338.7569 1463.3,338.4912 Q1463.8938,338.21 1464.5188,337.6319 L1464.5188,340.3506 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="195.5557" x="1475.55" y="339.5567">CommissionedClassification</text><line style="stroke:#181818;stroke-width:0.5;" x1="1447.55" x2="1673.1057" y1="350.71" y2="350.71"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="1454.55" y="361.3584"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="99.2646" x="1466.55" y="367.7051">salary: double</text><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="1454.55" y="377.6553"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="172.6348" x="1466.55" y="384.002">commissionRate: double</text><line style="stroke:#181818;stroke-width:0.5;" x1="1447.55" x2="1673.1057" y1="391.3037" y2="391.3037"></line></g><!--class TimeCard--><g class="entity" data-entity="TimeCard" data-source-line="35" data-uid="ent0014" id="entity_TimeCard"><rect fill="#F1F1F1" height="80.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="122.2432" x="1007.21" y="467.46"></rect><ellipse cx="1032.3592" cy="483.46" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M1035.3279,489.1006 Q1034.7498,489.3975 1034.1092,489.5381 Q1033.4685,489.6944 1032.7654,489.6944 Q1030.2654,489.6944 1028.9373,488.0537 Q1027.6248,486.3975 1027.6248,483.2725 Q1027.6248,480.1475 1028.9373,478.4912 Q1030.2654,476.835 1032.7654,476.835 Q1033.4685,476.835 1034.1092,476.9912 Q1034.7654,477.1475 1035.3279,477.4444 L1035.3279,480.1631 Q1034.7029,479.585 1034.1092,479.3194 Q1033.5154,479.0381 1032.8904,479.0381 Q1031.5467,479.0381 1030.8592,480.1162 Q1030.1717,481.1787 1030.1717,483.2725 Q1030.1717,485.3662 1030.8592,486.4444 Q1031.5467,487.5069 1032.8904,487.5069 Q1033.5154,487.5069 1034.1092,487.2412 Q1034.7029,486.96 1035.3279,486.3819 L1035.3279,489.1006 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="67.6895" x="1048.6145" y="488.3067">TimeCard</text><line style="stroke:#181818;stroke-width:0.5;" x1="1008.21" x2="1128.4532" y1="499.46" y2="499.46"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="1015.21" y="510.1084"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="82.5166" x="1027.21" y="516.4551">date: String</text><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="1015.21" y="526.4053"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="96.2432" x="1027.21" y="532.752">hours: double</text><line style="stroke:#181818;stroke-width:0.5;" x1="1008.21" x2="1128.4532" y1="540.0537" y2="540.0537"></line></g><!--class SalesRecipt--><g class="entity" data-entity="SalesRecipt" data-source-line="41" data-uid="ent0016" id="entity_SalesRecipt"><rect fill="#F1F1F1" height="80.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="136.8994" x="1491.88" y="467.46"></rect><ellipse cx="1517.3799" cy="483.46" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M1520.3486,489.1006 Q1519.7705,489.3975 1519.1299,489.5381 Q1518.4892,489.6944 1517.7861,489.6944 Q1515.2861,489.6944 1513.958,488.0537 Q1512.6455,486.3975 1512.6455,483.2725 Q1512.6455,480.1475 1513.958,478.4912 Q1515.2861,476.835 1517.7861,476.835 Q1518.4892,476.835 1519.1299,476.9912 Q1519.7861,477.1475 1520.3486,477.4444 L1520.3486,480.1631 Q1519.7236,479.585 1519.1299,479.3194 Q1518.5361,479.0381 1517.9111,479.0381 Q1516.5674,479.0381 1515.8799,480.1162 Q1515.1924,481.1787 1515.1924,483.2725 Q1515.1924,485.3662 1515.8799,486.4444 Q1516.5674,487.5069 1517.9111,487.5069 Q1518.5361,487.5069 1519.1299,487.2412 Q1519.7236,486.96 1520.3486,486.3819 L1520.3486,489.1006 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="81.5664" x="1533.7132" y="488.3067">SalesRecipt</text><line style="stroke:#181818;stroke-width:0.5;" x1="1492.88" x2="1627.7794" y1="499.46" y2="499.46"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="1499.88" y="510.1084"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="82.5166" x="1511.88" y="516.4551">date: String</text><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="1499.88" y="526.4053"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="110.8994" x="1511.88" y="532.752">amount: double</text><line style="stroke:#181818;stroke-width:0.5;" x1="1492.88" x2="1627.7794" y1="540.0537" y2="540.0537"></line></g><!--class HoldMethod--><g class="entity" data-entity="HoldMethod" data-source-line="47" data-uid="ent0018" id="entity_HoldMethod"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="116.376" x="457.14" y="335.01"></rect><ellipse cx="472.14" cy="351.01" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M475.1088,356.6506 Q474.5306,356.9475 473.89,357.0881 Q473.2494,357.2444 472.5463,357.2444 Q470.0463,357.2444 468.7181,355.6038 Q467.4056,353.9475 467.4056,350.8225 Q467.4056,347.6975 468.7181,346.0413 Q470.0463,344.385 472.5463,344.385 Q473.2494,344.385 473.89,344.5413 Q474.5463,344.6975 475.1088,344.9944 L475.1088,347.7131 Q474.4838,347.135 473.89,346.8694 Q473.2963,346.5881 472.6713,346.5881 Q471.3275,346.5881 470.64,347.6663 Q469.9525,348.7288 469.9525,350.8225 Q469.9525,352.9163 470.64,353.9944 Q471.3275,355.0569 472.6713,355.0569 Q473.2963,355.0569 473.89,354.7913 Q474.4838,354.51 475.1088,353.9319 L475.1088,356.6506 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="84.376" x="486.14" y="355.8567">HoldMethod</text><line style="stroke:#181818;stroke-width:0.5;" x1="458.14" x2="572.516" y1="367.01" y2="367.01"></line><line style="stroke:#181818;stroke-width:0.5;" x1="458.14" x2="572.516" y1="375.01" y2="375.01"></line></g><!--class MailMethod--><g class="entity" data-entity="MailMethod" data-source-line="48" data-uid="ent0020" id="entity_MailMethod"><rect fill="#F1F1F1" height="64.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="132.2578" x="608.2" y="326.86"></rect><ellipse cx="631.8911" cy="342.86" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M634.8598,348.5006 Q634.2817,348.7975 633.6411,348.9381 Q633.0004,349.0944 632.2973,349.0944 Q629.7973,349.0944 628.4692,347.4537 Q627.1567,345.7975 627.1567,342.6725 Q627.1567,339.5475 628.4692,337.8912 Q629.7973,336.235 632.2973,336.235 Q633.0004,336.235 633.6411,336.3912 Q634.2973,336.5475 634.8598,336.8444 L634.8598,339.5631 Q634.2348,338.985 633.6411,338.7194 Q633.0473,338.4381 632.4223,338.4381 Q631.0786,338.4381 630.3911,339.5162 Q629.7036,340.5787 629.7036,342.6725 Q629.7036,344.7662 630.3911,345.8444 Q631.0786,346.9069 632.4223,346.9069 Q633.0473,346.9069 633.6411,346.6412 Q634.2348,346.36 634.8598,345.7819 L634.8598,348.5006 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="80.9443" x="647.8224" y="347.7067">MailMethod</text><line style="stroke:#181818;stroke-width:0.5;" x1="609.2" x2="739.4578" y1="358.86" y2="358.86"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="616.2" y="369.5084"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="106.2578" x="628.2" y="375.8551">address: String</text><line style="stroke:#181818;stroke-width:0.5;" x1="609.2" x2="739.4578" y1="383.1569" y2="383.1569"></line></g><!--class DirectMethod--><g class="entity" data-entity="DirectMethod" data-source-line="51" data-uid="ent0022" id="entity_DirectMethod"><rect fill="#F1F1F1" height="80.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="132.7227" x="774.97" y="318.71"></rect><ellipse cx="792.6656" cy="334.71" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M795.6344,340.3506 Q795.0562,340.6475 794.4156,340.7881 Q793.775,340.9444 793.0719,340.9444 Q790.5719,340.9444 789.2437,339.3037 Q787.9312,337.6475 787.9312,334.5225 Q787.9312,331.3975 789.2437,329.7412 Q790.5719,328.085 793.0719,328.085 Q793.775,328.085 794.4156,328.2412 Q795.0719,328.3975 795.6344,328.6944 L795.6344,331.4131 Q795.0094,330.835 794.4156,330.5694 Q793.8219,330.2881 793.1969,330.2881 Q791.8531,330.2881 791.1656,331.3662 Q790.4781,332.4287 790.4781,334.5225 Q790.4781,336.6162 791.1656,337.6944 Q791.8531,338.7569 793.1969,338.7569 Q793.8219,338.7569 794.4156,338.4912 Q795.0094,338.21 795.6344,337.6319 L795.6344,340.3506 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="94.7324" x="807.2646" y="339.5567">DirectMethod</text><line style="stroke:#181818;stroke-width:0.5;" x1="775.97" x2="906.6927" y1="350.71" y2="350.71"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="782.97" y="361.3584"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="85.3945" x="794.97" y="367.7051">bank: String</text><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="782.97" y="377.6553"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="106.7227" x="794.97" y="384.002">account: String</text><line style="stroke:#181818;stroke-width:0.5;" x1="775.97" x2="906.6927" y1="391.3037" y2="391.3037"></line></g><!--link PaymentClassfication to Employee--><g class="link" data-entity-1="PaymentClassfication" data-entity-2="Employee" data-source-line="20" data-uid="lnk5" id="link_PaymentClassfication_Employee"><path codeline="20" d="M189.98,128.78 C201.48,128.78 200.98,128.78 212.48,128.78" fill="none" id="PaymentClassfication-to-Employee" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="224.48,128.78,218.48,124.78,212.48,128.78,218.48,132.78,224.48,128.78" style="stroke:#181818;stroke-width:1;"></polygon></g><!--reverse link Employee to PaymentMethod--><g class="link" data-entity-1="Employee" data-entity-2="PaymentMethod" data-source-line="21" data-uid="lnk6" id="link_Employee_PaymentMethod"><path codeline="21" d="M578.44,128.78 C589.96,128.78 589.48,128.78 601,128.78" fill="none" id="Employee-backto-PaymentMethod" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="566.44,128.78,572.44,132.78,578.44,128.78,572.44,124.78,566.44,128.78" style="stroke:#181818;stroke-width:1;"></polygon></g><!--reverse link PaymentClassification to HourlyClassification--><g class="link" data-entity-1="PaymentClassification" data-entity-2="HourlyClassification" data-source-line="24" data-uid="lnk9" id="link_PaymentClassification_HourlyClassification"><path d="M1281.4391,165.0038 C1240.8991,201.7238 1174.33,262.02 1121.11,310.21" fill="none" id="PaymentClassification-backto-HourlyClassification" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="1294.78,152.92,1277.4111,160.5569,1285.467,169.4508,1294.78,152.92" style="stroke:#181818;stroke-width:1;"></polygon></g><!--reverse link PaymentClassification to SalariedClassification--><g class="link" data-entity-1="PaymentClassification" data-entity-2="SalariedClassification" data-source-line="29" data-uid="lnk11" id="link_PaymentClassification_SalariedClassification"><path d="M1320.33,170.92 C1320.33,212.06 1320.33,279.96 1320.33,326.47" fill="none" id="PaymentClassification-backto-SalariedClassification" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="1320.33,152.92,1314.33,170.92,1326.33,170.92,1320.33,152.92" style="stroke:#181818;stroke-width:1;"></polygon></g><!--reverse link PaymentClassification to CommissionedClassification--><g class="link" data-entity-1="PaymentClassification" data-entity-2="CommissionedClassification" data-source-line="32" data-uid="lnk13" id="link_PaymentClassification_CommissionedClassification"><path d="M1357.7131,165.3248 C1398.5831,204.1948 1468.44,270.63 1518.71,318.43" fill="none" id="PaymentClassification-backto-CommissionedClassification" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="1344.67,152.92,1353.5781,169.6725,1361.848,160.9771,1344.67,152.92" style="stroke:#181818;stroke-width:1;"></polygon></g><!--reverse link HourlyClassification to TimeCard--><g class="link" data-entity-1="HourlyClassification" data-entity-2="TimeCard" data-source-line="39" data-uid="lnk15" id="link_HourlyClassification_TimeCard"><path codeline="39" d="M1068.33,419.65 C1068.33,438.9 1068.33,448.85 1068.33,467.2" fill="none" id="HourlyClassification-backto-TimeCard" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="1068.33,407.65,1064.33,413.65,1068.33,419.65,1072.33,413.65,1068.33,407.65" style="stroke:#181818;stroke-width:1;"></polygon></g><!--reverse link CommissionedClassification to SalesRecipt--><g class="link" data-entity-1="CommissionedClassification" data-entity-2="SalesRecipt" data-source-line="45" data-uid="lnk17" id="link_CommissionedClassification_SalesRecipt"><path codeline="45" d="M1560.33,411.72 C1560.33,432.6 1560.33,446.13 1560.33,467.01" fill="none" id="CommissionedClassification-backto-SalesRecipt" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="1560.33,399.72,1556.33,405.72,1560.33,411.72,1564.33,405.72,1560.33,399.72" style="stroke:#181818;stroke-width:1;"></polygon></g><!--reverse link PaymentMethod to HoldMethod--><g class="link" data-entity-1="PaymentMethod" data-entity-2="HoldMethod" data-source-line="47" data-uid="lnk19" id="link_PaymentMethod_HoldMethod"><path d="M647.9228,167.6907 C617.4528,211.4407 562,291.02 531.5,334.81" fill="none" id="PaymentMethod-backto-HoldMethod" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="658.21,152.92,642.9993,164.2617,652.8464,171.1198,658.21,152.92" style="stroke:#181818;stroke-width:1;"></polygon></g><!--reverse link PaymentMethod to MailMethod--><g class="link" data-entity-1="PaymentMethod" data-entity-2="MailMethod" data-source-line="49" data-uid="lnk21" id="link_PaymentMethod_MailMethod"><path d="M674.33,170.92 C674.33,212.06 674.33,279.96 674.33,326.47" fill="none" id="PaymentMethod-backto-MailMethod" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="674.33,152.92,668.33,170.92,680.33,170.92,674.33,152.92" style="stroke:#181818;stroke-width:1;"></polygon></g><!--reverse link PaymentMethod to DirectMethod--><g class="link" data-entity-1="PaymentMethod" data-entity-2="DirectMethod" data-source-line="52" data-uid="lnk23" id="link_PaymentMethod_DirectMethod"><path d="M701.8913,167.445 C730.3413,206.315 777.39,270.63 812.37,318.43" fill="none" id="PaymentMethod-backto-DirectMethod" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="691.26,152.92,697.0496,170.9888,706.7329,163.9013,691.26,152.92" style="stroke:#181818;stroke-width:1;"></polygon></g><!--SRC=[hPD1RiCW44Ntd89bciONo3QDb2uILKalC85fWch00YBLYdht6eCnZcXQLVMEuS_dpGV3qJe3p55MWxMKla0hKRcLNxq91aveHM0gYfejkhFcX8JYMZQrRX7fbT3kgr0spvmkgL0k51H8xDO7PuGwXH9mRh3hdLQR0a8dAPBb3O5dL0vyNlEO-6OzsCBJBEBv3r5oGhVscxEiiEjq-Jgd40D64jYV1AD3e2jqferFGaepqsgUXY4fzNbLlfQDlfYwdT9G_72ekAL5rdX_vxvn3mwNbElBiSP8MdASZUfiqaqgzjC4e0FKO0JoFo1PtzecdC5nfQKKdLgh_t3jQonPJW8OJdmL4bTWU7JWlIP_mZuEcxKLRs5ULSc9ZEcWtICJZVlM7AI-A9Uvtmd0dv5vZg-Yvl5tkOaelfuWsuAexyckazyuKGunFGc3pFt2u0Zg_MP6niAGW-KN]--></g></svg></p><h2 id="3增加雇员">3.增加雇员 </h2>
<p>所有的操作均以抽象类Transaction进行封装，其中只有一个execute()方法。<br>
class Transaction {<br>
public:<br>
virtual ~Transaction();<br>
virtual void execute() = 0;<br>
};</p>
<p>增加雇员的三种操作方式分别用AddEmployeeTransaction的三个派生类表示。增加雇员时需要创建Employee对象，除了设置雇员编号、雇员名字和地址，设置薪金支付方式默认为HoldMethod，另外还要设置雇员的薪金计算方式。创建好雇员记录后，还应该保存到数据库中。三个派生类的不同之处就在于所创建的雇员的薪金计算方式不同，因此三个派生类通过改写getClassification()抽象方法创建具体的薪金计算方式</p>
<p class="plantuml"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" data-diagram-type="CLASS" height="548px" preserveAspectRatio="none" style="width:949px;height:548px;background:#FFFFFF;" version="1.1" viewBox="0 0 949 548" width="949px" zoomAndPan="magnify"><defs></defs><g><!--class Transaction--><g class="entity" data-entity="Transaction" data-source-line="1" data-uid="ent0002" id="entity_Transaction"><rect fill="#F1F1F1" height="64.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="114.1475" x="157.29" y="361.52"></rect><ellipse cx="172.29" cy="377.52" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M175.2588,383.1606 Q174.6806,383.4575 174.04,383.5981 Q173.3994,383.7544 172.6963,383.7544 Q170.1963,383.7544 168.8681,382.1138 Q167.5556,380.4575 167.5556,377.3325 Q167.5556,374.2075 168.8681,372.5513 Q170.1963,370.895 172.6963,370.895 Q173.3994,370.895 174.04,371.0513 Q174.6963,371.2075 175.2588,371.5044 L175.2588,374.2231 Q174.6338,373.645 174.04,373.3794 Q173.4463,373.0981 172.8213,373.0981 Q171.4775,373.0981 170.79,374.1763 Q170.1025,375.2388 170.1025,377.3325 Q170.1025,379.4263 170.79,380.5044 Q171.4775,381.5669 172.8213,381.5669 Q173.4463,381.5669 174.04,381.3013 Q174.6338,381.02 175.2588,380.4419 L175.2588,383.1606 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="82.1475" x="186.29" y="382.3667">Transaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="158.29" x2="270.4375" y1="393.52" y2="393.52"></line><line style="stroke:#181818;stroke-width:0.5;" x1="158.29" x2="270.4375" y1="401.52" y2="401.52"></line><ellipse cx="168.29" cy="415.1684" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="67.1084" x="177.29" y="418.5151">execute()</text></g><!--class Employee--><g class="entity" data-entity="Employee" data-source-line="5" data-uid="ent0003" id="entity_Employee"><rect fill="#F1F1F1" height="80.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="150.9541" x="376.89" y="353.38"></rect><ellipse cx="414.2177" cy="369.38" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M417.1865,375.0206 Q416.6084,375.3175 415.9677,375.4581 Q415.3271,375.6144 414.624,375.6144 Q412.124,375.6144 410.7959,373.9738 Q409.4834,372.3175 409.4834,369.1925 Q409.4834,366.0675 410.7959,364.4113 Q412.124,362.755 414.624,362.755 Q415.3271,362.755 415.9677,362.9113 Q416.624,363.0675 417.1865,363.3644 L417.1865,366.0831 Q416.5615,365.505 415.9677,365.2394 Q415.374,364.9581 414.749,364.9581 Q413.4052,364.9581 412.7177,366.0363 Q412.0302,367.0988 412.0302,369.1925 Q412.0302,371.2863 412.7177,372.3644 Q413.4052,373.4269 414.749,373.4269 Q415.374,373.4269 415.9677,373.1613 Q416.5615,372.88 417.1865,372.3019 L417.1865,375.0206 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="69.3369" x="433.1795" y="374.2267">Employee</text><line style="stroke:#181818;stroke-width:0.5;" x1="377.89" x2="526.8441" y1="385.38" y2="385.38"></line><line style="stroke:#181818;stroke-width:0.5;" x1="377.89" x2="526.8441" y1="393.38" y2="393.38"></line><ellipse cx="387.89" cy="407.0284" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="124.9541" x="396.89" y="410.3751">setClassification()</text><ellipse cx="387.89" cy="423.3253" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="84.8271" x="396.89" y="426.672">setMethod()</text></g><!--class AddEmployeeTransaction--><g class="entity" data-entity="AddEmployeeTransaction" data-source-line="10" data-uid="ent0004" id="entity_AddEmployeeTransaction"><rect fill="#F1F1F1" height="129.4844" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="210.835" x="218.95" y="163.89"></rect><ellipse cx="233.95" cy="179.89" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M236.9188,185.5306 Q236.3406,185.8275 235.7,185.9681 Q235.0594,186.1244 234.3563,186.1244 Q231.8563,186.1244 230.5281,184.4838 Q229.2156,182.8275 229.2156,179.7025 Q229.2156,176.5775 230.5281,174.9213 Q231.8563,173.265 234.3563,173.265 Q235.0594,173.265 235.7,173.4213 Q236.3563,173.5775 236.9188,173.8744 L236.9188,176.5931 Q236.2938,176.015 235.7,175.7494 Q235.1063,175.4681 234.4813,175.4681 Q233.1375,175.4681 232.45,176.5463 Q231.7625,177.6088 231.7625,179.7025 Q231.7625,181.7963 232.45,182.8744 Q233.1375,183.9369 234.4813,183.9369 Q235.1063,183.9369 235.7,183.6713 Q236.2938,183.39 236.9188,182.8119 L236.9188,185.5306 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="178.835" x="247.95" y="184.7367">AddEmployeeTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="219.95" x2="428.785" y1="195.89" y2="195.89"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="226.95" y="206.5384"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="44.1533" x="238.95" y="212.8851">empId</text><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="226.95" y="222.8353"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="39.7031" x="238.95" y="229.182">name</text><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="226.95" y="239.1322"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="55.3096" x="238.95" y="245.4789">address</text><line style="stroke:#181818;stroke-width:0.5;" x1="219.95" x2="428.785" y1="252.7806" y2="252.7806"></line><ellipse cx="229.95" cy="266.4291" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="67.1084" x="238.95" y="269.7757">execute()</text><ellipse cx="229.95" cy="282.7259" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="126.5469" x="238.95" y="286.0726">getClassification()</text></g><!--class PayrollDatabase--><g class="entity" data-entity="PayrollDatabase" data-source-line="21" data-uid="ent0007" id="entity_PayrollDatabase"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="146.208" x="315.26" y="493.97"></rect><ellipse cx="330.26" cy="509.97" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M333.2288,515.6106 Q332.6506,515.9075 332.01,516.0481 Q331.3694,516.2044 330.6663,516.2044 Q328.1663,516.2044 326.8381,514.5638 Q325.5256,512.9075 325.5256,509.7825 Q325.5256,506.6575 326.8381,505.0013 Q328.1663,503.345 330.6663,503.345 Q331.3694,503.345 332.01,503.5013 Q332.6663,503.6575 333.2288,503.9544 L333.2288,506.6731 Q332.6038,506.095 332.01,505.8294 Q331.4163,505.5481 330.7913,505.5481 Q329.4475,505.5481 328.76,506.6263 Q328.0725,507.6888 328.0725,509.7825 Q328.0725,511.8763 328.76,512.9544 Q329.4475,514.0169 330.7913,514.0169 Q331.4163,514.0169 332.01,513.7513 Q332.6038,513.47 333.2288,512.8919 L333.2288,515.6106 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="114.208" x="344.26" y="514.8167">PayrollDatabase</text><line style="stroke:#181818;stroke-width:0.5;" x1="316.26" x2="460.468" y1="525.97" y2="525.97"></line><line style="stroke:#181818;stroke-width:0.5;" x1="316.26" x2="460.468" y1="533.97" y2="533.97"></line></g><!--class AddHourlyEmployeeTransaction--><g class="entity" data-entity="AddHourlyEmployeeTransaction" data-source-line="25" data-uid="ent0010" id="entity_AddHourlyEmployeeTransaction"><rect fill="#F1F1F1" height="80.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="256.7314" x="7" y="15.15"></rect><ellipse cx="22" cy="31.15" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M24.9688,36.7906 Q24.3906,37.0875 23.75,37.2281 Q23.1094,37.3844 22.4063,37.3844 Q19.9063,37.3844 18.5781,35.7437 Q17.2656,34.0875 17.2656,30.9625 Q17.2656,27.8375 18.5781,26.1812 Q19.9063,24.525 22.4063,24.525 Q23.1094,24.525 23.75,24.6812 Q24.4063,24.8375 24.9688,25.1344 L24.9688,27.8531 Q24.3438,27.275 23.75,27.0094 Q23.1563,26.7281 22.5313,26.7281 Q21.1875,26.7281 20.5,27.8062 Q19.8125,28.8687 19.8125,30.9625 Q19.8125,33.0562 20.5,34.1344 Q21.1875,35.1969 22.5313,35.1969 Q23.1563,35.1969 23.75,34.9312 Q24.3438,34.65 24.9688,34.0719 L24.9688,36.7906 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="224.7314" x="36" y="35.9967">AddHourlyEmployeeTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="8" x2="262.7314" y1="47.15" y2="47.15"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="15" y="57.7984"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="76.6514" x="27" y="64.1451">hourlyRate</text><line style="stroke:#181818;stroke-width:0.5;" x1="8" x2="262.7314" y1="71.4469" y2="71.4469"></line><ellipse cx="18" cy="85.0953" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="126.5469" x="27" y="88.442">getClassification()</text></g><!--class HourlyClassification--><g class="entity" data-entity="HourlyClassification" data-source-line="31" data-uid="ent0012" id="entity_HourlyClassification"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="170.5303" x="13.1" y="204.63"></rect><ellipse cx="28.1" cy="220.63" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M31.0688,226.2706 Q30.4906,226.5675 29.85,226.7081 Q29.2094,226.8644 28.5063,226.8644 Q26.0063,226.8644 24.6781,225.2238 Q23.3656,223.5675 23.3656,220.4425 Q23.3656,217.3175 24.6781,215.6613 Q26.0063,214.005 28.5063,214.005 Q29.2094,214.005 29.85,214.1613 Q30.5063,214.3175 31.0688,214.6144 L31.0688,217.3331 Q30.4438,216.755 29.85,216.4894 Q29.2563,216.2081 28.6313,216.2081 Q27.2875,216.2081 26.6,217.2863 Q25.9125,218.3488 25.9125,220.4425 Q25.9125,222.5363 26.6,223.6144 Q27.2875,224.6769 28.6313,224.6769 Q29.2563,224.6769 29.85,224.4113 Q30.4438,224.13 31.0688,223.5519 L31.0688,226.2706 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="138.5303" x="42.1" y="225.4767">HourlyClassification</text><line style="stroke:#181818;stroke-width:0.5;" x1="14.1" x2="182.6303" y1="236.63" y2="236.63"></line><line style="stroke:#181818;stroke-width:0.5;" x1="14.1" x2="182.6303" y1="244.63" y2="244.63"></line></g><!--class AddSalariedEmployeeTransaction--><g class="entity" data-entity="AddSalariedEmployeeTransaction" data-source-line="36" data-uid="ent0014" id="entity_AddSalariedEmployeeTransaction"><rect fill="#F1F1F1" height="80.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="267.915" x="316.41" y="15.15"></rect><ellipse cx="331.41" cy="31.15" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M334.3788,36.7906 Q333.8006,37.0875 333.16,37.2281 Q332.5194,37.3844 331.8163,37.3844 Q329.3163,37.3844 327.9881,35.7437 Q326.6756,34.0875 326.6756,30.9625 Q326.6756,27.8375 327.9881,26.1812 Q329.3163,24.525 331.8163,24.525 Q332.5194,24.525 333.16,24.6812 Q333.8163,24.8375 334.3788,25.1344 L334.3788,27.8531 Q333.7538,27.275 333.16,27.0094 Q332.5663,26.7281 331.9413,26.7281 Q330.5975,26.7281 329.91,27.8062 Q329.2225,28.8687 329.2225,30.9625 Q329.2225,33.0562 329.91,34.1344 Q330.5975,35.1969 331.9413,35.1969 Q332.5663,35.1969 333.16,34.9312 Q333.7538,34.65 334.3788,34.0719 L334.3788,36.7906 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="235.915" x="345.41" y="35.9967">AddSalariedEmployeeTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="317.41" x2="583.325" y1="47.15" y2="47.15"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="324.41" y="57.7984"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="42.3828" x="336.41" y="64.1451">salary</text><line style="stroke:#181818;stroke-width:0.5;" x1="317.41" x2="583.325" y1="71.4469" y2="71.4469"></line><ellipse cx="327.41" cy="85.0953" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="126.5469" x="336.41" y="88.442">getClassification()</text></g><!--class SalariedClassification--><g class="entity" data-entity="SalariedClassification" data-source-line="41" data-uid="ent0016" id="entity_SalariedClassification"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="181.7139" x="464.51" y="204.63"></rect><ellipse cx="479.51" cy="220.63" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M482.4788,226.2706 Q481.9006,226.5675 481.26,226.7081 Q480.6194,226.8644 479.9163,226.8644 Q477.4163,226.8644 476.0881,225.2238 Q474.7756,223.5675 474.7756,220.4425 Q474.7756,217.3175 476.0881,215.6613 Q477.4163,214.005 479.9163,214.005 Q480.6194,214.005 481.26,214.1613 Q481.9163,214.3175 482.4788,214.6144 L482.4788,217.3331 Q481.8538,216.755 481.26,216.4894 Q480.6663,216.2081 480.0413,216.2081 Q478.6975,216.2081 478.01,217.2863 Q477.3225,218.3488 477.3225,220.4425 Q477.3225,222.5363 478.01,223.6144 Q478.6975,224.6769 480.0413,224.6769 Q480.6663,224.6769 481.26,224.4113 Q481.8538,224.13 482.4788,223.5519 L482.4788,226.2706 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="149.7139" x="493.51" y="225.4767">SalariedClassification</text><line style="stroke:#181818;stroke-width:0.5;" x1="465.51" x2="645.2239" y1="236.63" y2="236.63"></line><line style="stroke:#181818;stroke-width:0.5;" x1="465.51" x2="645.2239" y1="244.63" y2="244.63"></line></g><!--class AddCommissionedEmployeeTransaction--><g class="entity" data-entity="AddCommissionedEmployeeTransaction" data-source-line="44" data-uid="ent0018" id="entity_AddCommissionedEmployeeTransaction"><rect fill="#F1F1F1" height="96.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="313.7568" x="628.49" y="7"></rect><ellipse cx="643.49" cy="23" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M646.4588,28.6406 Q645.8806,28.9375 645.24,29.0781 Q644.5994,29.2344 643.8963,29.2344 Q641.3963,29.2344 640.0681,27.5938 Q638.7556,25.9375 638.7556,22.8125 Q638.7556,19.6875 640.0681,18.0313 Q641.3963,16.375 643.8963,16.375 Q644.5994,16.375 645.24,16.5313 Q645.8963,16.6875 646.4588,16.9844 L646.4588,19.7031 Q645.8338,19.125 645.24,18.8594 Q644.6463,18.5781 644.0213,18.5781 Q642.6775,18.5781 641.99,19.6563 Q641.3025,20.7188 641.3025,22.8125 Q641.3025,24.9063 641.99,25.9844 Q642.6775,27.0469 644.0213,27.0469 Q644.6463,27.0469 645.24,26.7813 Q645.8338,26.5 646.4588,25.9219 L646.4588,28.6406 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="281.7568" x="657.49" y="27.8467">AddCommissionedEmployeeTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="629.49" x2="941.2468" y1="39" y2="39"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="636.49" y="49.6484"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="42.3828" x="648.49" y="55.9951">salary</text><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="636.49" y="65.9453"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="115.7529" x="648.49" y="72.292">commissionRate</text><line style="stroke:#181818;stroke-width:0.5;" x1="629.49" x2="941.2468" y1="79.5938" y2="79.5938"></line><ellipse cx="639.49" cy="93.2422" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="126.5469" x="648.49" y="96.5889">getClassification()</text></g><!--class CommissionedClassification--><g class="entity" data-entity="CommissionedClassification" data-source-line="51" data-uid="ent0020" id="entity_CommissionedClassification"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="227.5557" x="681.59" y="204.63"></rect><ellipse cx="696.59" cy="220.63" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M699.5588,226.2706 Q698.9806,226.5675 698.34,226.7081 Q697.6994,226.8644 696.9963,226.8644 Q694.4963,226.8644 693.1681,225.2238 Q691.8556,223.5675 691.8556,220.4425 Q691.8556,217.3175 693.1681,215.6613 Q694.4963,214.005 696.9963,214.005 Q697.6994,214.005 698.34,214.1613 Q698.9963,214.3175 699.5588,214.6144 L699.5588,217.3331 Q698.9338,216.755 698.34,216.4894 Q697.7463,216.2081 697.1213,216.2081 Q695.7775,216.2081 695.09,217.2863 Q694.4025,218.3488 694.4025,220.4425 Q694.4025,222.5363 695.09,223.6144 Q695.7775,224.6769 697.1213,224.6769 Q697.7463,224.6769 698.34,224.4113 Q698.9338,224.13 699.5588,223.5519 L699.5588,226.2706 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="195.5557" x="710.59" y="225.4767">CommissionedClassification</text><line style="stroke:#181818;stroke-width:0.5;" x1="682.59" x2="908.1457" y1="236.63" y2="236.63"></line><line style="stroke:#181818;stroke-width:0.5;" x1="682.59" x2="908.1457" y1="244.63" y2="244.63"></line></g><!--link AddEmployeeTransaction to Transaction--><g class="link" data-entity-1="AddEmployeeTransaction" data-entity-2="Transaction" data-source-line="17" data-uid="lnk5" id="link_AddEmployeeTransaction_Transaction"><path codeline="17" d="M281.21,293.6 C265.56,316.8 258.637,327.0584 245.697,346.2384" fill="none" id="AddEmployeeTransaction-to-Transaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="235.63,361.16,250.6709,349.5941,240.7232,342.8827,235.63,361.16" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link AddEmployeeTransaction to Employee--><g class="link" data-entity-1="AddEmployeeTransaction" data-entity-2="Employee" data-source-line="18" data-uid="lnk6" id="link_AddEmployeeTransaction_Employee"><path codeline="18" d="M374.59,293.6 C390.42,313.77 407.43,335.43 421.49,353.34" fill="none" id="AddEmployeeTransaction-Employee" style="stroke:#181818;stroke-width:1;"></path><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="8.271" x="371.6604" y="313.6003">1</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="8.271" x="407.5188" y="342.1963">1</text></g><!--link Employee to PayrollDatabase--><g class="link" data-entity-1="Employee" data-entity-2="PayrollDatabase" data-source-line="23" data-uid="lnk8" id="link_Employee_PayrollDatabase"><path codeline="23" d="M431.59,434.38 C421.37,453.91 412.1833,471.4646 403.4333,488.1746" fill="none" id="Employee-to-PayrollDatabase" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="400.65,493.49,408.3686,487.3725,402.9694,489.0605,401.2814,483.6614,400.65,493.49" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link AddEmployeeTransaction to PayrollDatabase--><g class="link" data-entity-1="AddEmployeeTransaction" data-entity-2="PayrollDatabase" data-source-line="24" data-uid="lnk9" id="link_AddEmployeeTransaction_PayrollDatabase"><path codeline="24" d="M332.55,293.72 C338.41,334.28 347.39,387.62 359.37,433.97 C364.67,454.51 370.6282,471.6153 376.9182,488.0753" fill="none" id="AddEmployeeTransaction-to-PayrollDatabase" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="379.06,493.68,379.5838,483.8451,377.2752,489.0094,372.1109,486.7008,379.06,493.68" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link AddHourlyEmployeeTransaction to AddEmployeeTransaction--><g class="link" data-entity-1="AddHourlyEmployeeTransaction" data-entity-2="AddEmployeeTransaction" data-source-line="29" data-uid="lnk11" id="link_AddHourlyEmployeeTransaction_AddEmployeeTransaction"><path codeline="29" d="M179.2,96.15 C201.34,116.2 215.4008,128.9342 240.4108,151.5942" fill="none" id="AddHourlyEmployeeTransaction-to-AddEmployeeTransaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="253.75,163.68,244.4394,147.1478,236.3822,156.0406,253.75,163.68" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link AddHourlyEmployeeTransaction to HourlyClassification--><g class="link" data-entity-1="AddHourlyEmployeeTransaction" data-entity-2="HourlyClassification" data-source-line="33" data-uid="lnk13" id="link_AddHourlyEmployeeTransaction_HourlyClassification"><path codeline="33" d="M126.78,96.15 C119.53,129.73 110.6491,170.8258 104.6391,198.5958" fill="none" id="AddHourlyEmployeeTransaction-to-HourlyClassification" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="103.37,204.46,109.1832,196.5097,104.4276,199.5731,101.3642,194.8175,103.37,204.46" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link AddSalariedEmployeeTransaction to AddEmployeeTransaction--><g class="link" data-entity-1="AddSalariedEmployeeTransaction" data-entity-2="AddEmployeeTransaction" data-source-line="40" data-uid="lnk15" id="link_AddSalariedEmployeeTransaction_AddEmployeeTransaction"><path codeline="40" d="M421.14,96.15 C406.38,116.2 398.7906,126.5239 382.1106,149.1839" fill="none" id="AddSalariedEmployeeTransaction-to-AddEmployeeTransaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="371.44,163.68,386.9426,152.7407,377.2785,145.627,371.44,163.68" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link AddSalariedEmployeeTransaction to SalariedClassification--><g class="link" data-entity-1="AddSalariedEmployeeTransaction" data-entity-2="SalariedClassification" data-source-line="43" data-uid="lnk17" id="link_AddSalariedEmployeeTransaction_SalariedClassification"><path codeline="43" d="M474.72,96.15 C495.32,129.73 520.9833,171.5752 538.0133,199.3452" fill="none" id="AddSalariedEmployeeTransaction-to-SalariedClassification" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="541.15,204.46,539.8549,194.6967,538.5361,200.1977,533.0351,198.8789,541.15,204.46" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link AddCommissionedEmployeeTransaction to AddEmployeeTransaction--><g class="link" data-entity-1="AddCommissionedEmployeeTransaction" data-entity-2="AddEmployeeTransaction" data-source-line="49" data-uid="lnk19" id="link_AddCommissionedEmployeeTransaction_AddEmployeeTransaction"><path codeline="49" d="M628.14,100.33 C570.51,118.01 505.24,139.9 447.37,163.89 C441.7,166.24 452.3295,161.308 446.5595,163.928" fill="none" id="AddCommissionedEmployeeTransaction-to-AddEmployeeTransaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="430.17,171.37,449.0402,169.3911,444.0788,158.4648,430.17,171.37" style="stroke:#181818;stroke-width:1;"></polygon></g><!--link AddCommissionedEmployeeTransaction to CommissionedClassification--><g class="link" data-entity-1="AddCommissionedEmployeeTransaction" data-entity-2="CommissionedClassification" data-source-line="53" data-uid="lnk21" id="link_AddCommissionedEmployeeTransaction_CommissionedClassification"><path codeline="53" d="M788.15,104.13 C790.06,136.78 792.1496,172.6602 793.6496,198.3002" fill="none" id="AddCommissionedEmployeeTransaction-to-CommissionedClassification" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="794,204.29,797.4676,195.0718,793.708,199.2985,789.4812,195.539,794,204.29" style="stroke:#181818;stroke-width:1;"></polygon></g><!--SRC=[ZLBBJiGW5Dtp5MHM6iF27o0neuakJ8pw0rUuEYIqJ819RBJ_Rakds4bvb0sGUywvznmG6foZxnPQ1y8hqz8VGeTrG_4RnSdZrJNf2H41zj0SjUaG8yQXtuyLzQa4ZEm17IlFw0z6BlbtKiuIwuwCOdDyakTp2msUZo2bHUTMOqtthyG8FSbqOkoNNvZD0NUtkm4SjcYQp3PUeBD6wtlmy05kJACd4SKONm7ouoImCQf7SxAwAmLs28XNy5WB8wyL8idCDnkUs9VAmNL5cQUPPF4Vta23LLZy5sx4T3MB9QMYoMcMcPvsMHRdEVQ_pxrf6ZMKJBlPAwCYahQySQt5bfTUQgIJg7VX1PK_]--></g></svg></p><p>下面是增加钟点工的测试。<br>
void testAddHourlyEmployee() {<br>
int empId = 1001;<br>
string name = "Bob";<br>
string addr = "HuangHe 5 Rd. 391";<br>
double hourlyRate = 8.0;<br>
//增加钟点工<br>
AddHourlyEmployeeTransaction<br>
t(empId, name, addr, hourlyRate);<br>
t.execute();<br>
//验证增加的雇员<br>
Employee *e = PayrollDatabase::getEmployee(empId);<br>
assert(e-&gt;getEmpId() == empId);<br>
assert(e-&gt;getName() == name);<br>
assert(e-&gt;getAddress() == addr);<br>
PaymentClassification *pc = e-&gt;getClassification();<br>
HourlyClassification *hc =<br>
dynamic_cast&lt;HourlyClassification *&gt;(pc);<br>
assert(hc);<br>
assert(fabs(hc-&gt;getHourlyRate() - hourlyRate)&lt;0.01);<br>
PaymentMethod *pm = e-&gt;getMethod();<br>
HoldMethod *hm =dynamic_cast&lt;HoldMethod *&gt;(pm);<br>
assert(hm);<br>
}</p>
<p>根据上述分析，在AddEmployeeTransaction类的execute()方法中实现增加雇员的操作。<br>
class AddEmployeeTransaction : public Transaction {<br>
int empId;<br>
string name;<br>
string address;<br>
public:<br>
AddEmployeeTransaction(int empId, string name,<br>
string address)<br>
: empId(empId), name(name), address(address)<br>
{}<br>
void execute() {<br>
Employee *e = new Employee(empId,name,address);<br>
e-&gt;setClassification(getClassification());	//薪金类型<br>
e-&gt;setMethod(new HoldMethod());	//支付方式<br>
PayrollDatabase::addEmployee(e);	//保存记录<br>
}<br>
virtual PaymentClassification *getClassification() = 0;<br>
};<br>
雇员的支付方式默认为HoldMethod，雇员的薪金类型通过抽象方法getClassification()确定，在派生类中改写为具体的薪金类型。比如，在AddHourlyEmployeeTransaction类中应该返回HourlyClassifi- cation。<br>
PaymentClassification *<br>
AddHourlyEmployeeTransaction::getClassification() {<br>
return new HourlyClassification(hourlyRate);<br>
}</p>
<p>目前，HourlyClassification类只要保存小时工资即可。<br>
class HourlyClassification : public PaymentClassification {<br>
double itsHourlyRate;<br>
public:<br>
HourlyClassification(double hourlyRate)<br>
: itsHourlyRate(hourlyRate)<br>
{}<br>
double getHourlyRate() const { return itsHourlyRate; }<br>
};</p>
<p>最后一个问题，为了保存雇员记录，必须要建立真正的数据库么？其实不然，在开发初期简单地用一个std::map实现已经足矣。<br>
class PayrollDatabase {<br>
static map&lt;int, Employee *&gt; employees;<br>
public:<br>
static void addEmployee(Employee *e) {<br>
employees[e-&gt;getEmpId()] = e;<br>
}<br>
static Employee *getEmployee(int empId) {<br>
map&lt;int, Employee *&gt;::iterator it =<br>
employees.find(empId);<br>
if(it != employees.end())	//找到<br>
return it-&gt;second;<br>
else<br>
return 0;	//找不到<br>
}<br>
};</p>
<p>只要实现了其他几个必须的类，让测试能够通过，增加钟点工雇员的操作就实现了。另外两个增加雇员的类作为练习，注意先编写测试。</p>
<h2 id="4删除雇员">4.删除雇员 </h2>
<p>下面是删除雇员的测试，先增加一个雇员然后删除他并进行验证。<br>
void testDeleteEmployee() {<br>
int empId = 1004;<br>
AddSalariedEmployeeTransaction<br>
t(empId,"Bill","Address",3000.0);<br>
t.execute();<br>
Employee *e = PayrollDatabase::getEmployee(empId);<br>
assert(e);<br>
DeleteEmployeeTransaction det(empId);<br>
det.execute();<br>
e = PayrollDatabase::getEmployee(empId);<br>
assert(e == 0);<br>
}</p>
<p>DeleteEmployeeTransaction根据雇员编号从数据库中删除该雇员记录。<br>
void DeleteEmployeeTransaction::execute() {<br>
PayrollDatabase::deleteEmployee(empId);<br>
}</p>
<p>在数据库PayrollDatabase中实现deleteEmployee()方法。<br>
void PayrollDatabase::deleteEmployee(int empId) {<br>
employees.erase(empId);<br>
}</p>
<h2 id="5时间卡和销售凭条">5.时间卡和销售凭条 </h2>
<p>下面是提交时间卡的测试。<br>
void testTimeCard() {<br>
int empId = 1005;<br>
int date = 1;  //当月1号<br>
double hours = 4.0;<br>
AddHourlyEmployeeTransaction<br>
t(empId, "Bill", "Home", 8.0);<br>
t.execute();<br>
TimeCardTransaction tct(empId, date, hours);<br>
tct.execute();<br>
Employee *e = PayrollDatabase::getEmployee(empId);<br>
assert(e);<br>
PaymentClassification *pc = e-&gt;getClassification();<br>
HourlyClassification *hc =<br>
dynamic_cast&lt;HourlyClassification *&gt;(pc);<br>
assert(hc);<br>
TimeCard *tc = hc-&gt;getTimeCard(date);<br>
assert(tc);<br>
assert(fabs(tc-&gt;getHours() - hours)&lt;0.001);<br>
}</p>
<p>提交时间卡操作由TimeCardTransaction实现。提交时间卡时，首先根据雇员编号找到雇员记录，该雇员必须是薪金类型必须是HourlyClassification，然后根据参数中的日期和工作时数创建时间卡，并登记到HourlyClassification中。<br>
void TimeCardTransaction::execute() {<br>
Employee *e = PayrollDatabase::getEmployee(empId);<br>
if(e) {<br>
PaymentClassification *pc = e-&gt;getClassification();<br>
if(HourlyClassification *hc =<br>
dynamic_cast&lt;HourlyClassification *&gt;(pc))<br>
hc-&gt;addTimeCard(new TimeCard(date, hours));<br>
else<br>
throw("Add timecard to a non-hourly employee");<br>
} else<br>
throw("No such employee");<br>
}</p>
<p>时间卡类TimeCard只是封装了日期和工作时数。为了简单起见，这里的日期取值从1到31，只表示当月的日期。<br>
为了登记时间卡，需要修改HourlyClassification类。因为登记的时间卡数不会超过当月的天数，所以引入一个数组存放对应日期的时间卡。<br>
class HourlyClassification : public PaymentClassification {<br>
double itsHourlyRate;<br>
TimeCard *itsTimeCards[31];<br>
public:<br>
HourlyClassification(double hourlyRate)<br>
: itsHourlyRate(hourlyRate) {<br>
for(int i=0; i&lt;31; i++) itsTimeCards[i] = 0;<br>
}<br>
~HourlyClassification() {<br>
for(int i=0; i&lt;31; i++) delete itsTimeCards[i];<br>
}<br>
void addTimeCard(TimeCard *timeCard) {<br>
itsTimeCards[timeCard-&gt;getDate()-1] = timeCard;<br>
}<br>
TimeCard *getTimeCard(int date) const {<br>
return itsTimeCards[date-1];<br>
}<br>
};</p>
<p>登记销售凭条与登记时间卡类似。销售凭条中记录着日期和销售额，假设销售额为当天的合计。在CommissionedClassification中保存销售凭条。下面是登记销售凭条的测试，请实现相关部分。<br>
void testSalesReceipt() {<br>
int empId = 1006;<br>
int date = 1;<br>
double sales = 1000.0;<br>
AddCommissionedEmployeeTransaction<br>
t(empId, "Bill", "Home", 2000.0, 0.02);<br>
t.execute();<br>
SalesReceiptTransaction srt(empId,date,sales);<br>
srt.execute();<br>
Employee *e = PayrollDatabase::getEmployee(empId);<br>
assert(e);<br>
PaymentClassification *pc = e-&gt;getClassification();<br>
CommissionedClassification *cc =<br>
dynamic_cast&lt;CommissionedClassification *&gt;(pc);<br>
assert(cc);<br>
SalesReceipt *sr = cc-&gt;getSalesReceipt(date);<br>
assert(sr);<br>
assert(fabs(sr-&gt;getAmount() - sales)&lt;0.001);<br>
}</p>
<h2 id="更改雇员属性">更改雇员属性 </h2>
<p>更改雇员属性应该算是最复杂的操作了。不但可以更改雇员的名字和地址等基本信息，还可以更改雇员的薪金类型和支付方式。<br>
所有更改雇员属性的操作中都有一个共同的参数，就是雇员编号，而且所有更改操作都必须先取出雇员记录。这提示我们可以对所有更改属性的操作进行抽象。另外，薪金类型分三种，支付方式也分三种。进一步提示我们可以分别对两者进行抽象。于是得到如图10.6-1所示的静态模型。</p>
<p class="plantuml"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" data-diagram-type="CLASS" height="616px" preserveAspectRatio="none" style="width:2189px;height:616px;background:#FFFFFF;" version="1.1" viewBox="0 0 2189 616" width="2189px" zoomAndPan="magnify"><defs></defs><g><!--class Transaction--><g class="entity" data-entity="Transaction" data-source-line="1" data-uid="ent0002" id="entity_Transaction"><rect fill="#F1F1F1" height="64.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="114.1475" x="281.45" y="520.53"></rect><ellipse cx="296.45" cy="536.53" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M299.4188,542.1706 Q298.8406,542.4675 298.2,542.6081 Q297.5594,542.7644 296.8563,542.7644 Q294.3563,542.7644 293.0281,541.1238 Q291.7156,539.4675 291.7156,536.3425 Q291.7156,533.2175 293.0281,531.5613 Q294.3563,529.905 296.8563,529.905 Q297.5594,529.905 298.2,530.0613 Q298.8563,530.2175 299.4188,530.5144 L299.4188,533.2331 Q298.7938,532.655 298.2,532.3894 Q297.6063,532.1081 296.9813,532.1081 Q295.6375,532.1081 294.95,533.1863 Q294.2625,534.2488 294.2625,536.3425 Q294.2625,538.4363 294.95,539.5144 Q295.6375,540.5769 296.9813,540.5769 Q297.6063,540.5769 298.2,540.3113 Q298.7938,540.03 299.4188,539.4519 L299.4188,542.1706 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="82.1475" x="310.45" y="541.3767">Transaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="282.45" x2="394.5975" y1="552.53" y2="552.53"></line><line style="stroke:#181818;stroke-width:0.5;" x1="282.45" x2="394.5975" y1="560.53" y2="560.53"></line><ellipse cx="292.45" cy="574.1784" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="67.1084" x="301.45" y="577.5251">execute()</text></g><!--class ChangeEmployeeTransaction--><g class="entity" data-entity="ChangeEmployeeTransaction" data-source-line="5" data-uid="ent0003" id="entity_ChangeEmployeeTransaction"><rect fill="#F1F1F1" height="96.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="237.085" x="387.98" y="322.19"></rect><ellipse cx="402.98" cy="338.19" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M405.9488,343.8306 Q405.3706,344.1275 404.73,344.2681 Q404.0894,344.4244 403.3863,344.4244 Q400.8863,344.4244 399.5581,342.7838 Q398.2456,341.1275 398.2456,338.0025 Q398.2456,334.8775 399.5581,333.2213 Q400.8863,331.565 403.3863,331.565 Q404.0894,331.565 404.73,331.7213 Q405.3863,331.8775 405.9488,332.1744 L405.9488,334.8931 Q405.3238,334.315 404.73,334.0494 Q404.1363,333.7681 403.5113,333.7681 Q402.1675,333.7681 401.48,334.8463 Q400.7925,335.9088 400.7925,338.0025 Q400.7925,340.0963 401.48,341.1744 Q402.1675,342.2369 403.5113,342.2369 Q404.1363,342.2369 404.73,341.9713 Q405.3238,341.69 405.9488,341.1119 L405.9488,343.8306 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="205.085" x="416.98" y="343.0367">ChangeEmployeeTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="388.98" x2="624.065" y1="354.19" y2="354.19"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="395.98" y="364.8384"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="44.1533" x="407.98" y="371.1851">empId</text><line style="stroke:#181818;stroke-width:0.5;" x1="388.98" x2="624.065" y1="378.4869" y2="378.4869"></line><ellipse cx="398.98" cy="392.1353" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="67.1084" x="407.98" y="395.482">execute()</text><ellipse cx="398.98" cy="408.4322" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="81.9766" x="407.98" y="411.7789">doChange()</text></g><!--class Employee--><g class="entity" data-entity="Employee" data-source-line="12" data-uid="ent0005" id="entity_Employee"><rect fill="#F1F1F1" height="113.1875" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="150.9541" x="431.05" y="496.08"></rect><ellipse cx="468.3777" cy="512.08" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M471.3465,517.7206 Q470.7684,518.0175 470.1277,518.1581 Q469.4871,518.3144 468.784,518.3144 Q466.284,518.3144 464.9559,516.6737 Q463.6434,515.0175 463.6434,511.8925 Q463.6434,508.7675 464.9559,507.1112 Q466.284,505.455 468.784,505.455 Q469.4871,505.455 470.1277,505.6112 Q470.784,505.7675 471.3465,506.0644 L471.3465,508.7831 Q470.7215,508.205 470.1277,507.9394 Q469.534,507.6581 468.909,507.6581 Q467.5652,507.6581 466.8777,508.7362 Q466.1902,509.7987 466.1902,511.8925 Q466.1902,513.9862 466.8777,515.0644 Q467.5652,516.1269 468.909,516.1269 Q469.534,516.1269 470.1277,515.8612 Q470.7215,515.58 471.3465,515.0019 L471.3465,517.7206 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="69.3369" x="487.3395" y="516.9267">Employee</text><line style="stroke:#181818;stroke-width:0.5;" x1="432.05" x2="581.0041" y1="528.08" y2="528.08"></line><line style="stroke:#181818;stroke-width:0.5;" x1="432.05" x2="581.0041" y1="536.08" y2="536.08"></line><ellipse cx="442.05" cy="549.7284" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="73.623" x="451.05" y="553.0751">setName()</text><ellipse cx="442.05" cy="566.0253" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="88.6279" x="451.05" y="569.372">setAddress()</text><ellipse cx="442.05" cy="582.3222" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="124.9541" x="451.05" y="585.6689">setClassification()</text><ellipse cx="442.05" cy="598.6191" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="84.8271" x="451.05" y="601.9657">setMethod()</text></g><!--class PayrollDatabase--><g class="entity" data-entity="PayrollDatabase" data-source-line="20" data-uid="ent0007" id="entity_PayrollDatabase"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="146.208" x="617.42" y="528.68"></rect><ellipse cx="632.42" cy="544.68" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M635.3888,550.3206 Q634.8106,550.6175 634.17,550.7581 Q633.5294,550.9144 632.8263,550.9144 Q630.3263,550.9144 628.9981,549.2738 Q627.6856,547.6175 627.6856,544.4925 Q627.6856,541.3675 628.9981,539.7113 Q630.3263,538.055 632.8263,538.055 Q633.5294,538.055 634.17,538.2113 Q634.8263,538.3675 635.3888,538.6644 L635.3888,541.3831 Q634.7638,540.805 634.17,540.5394 Q633.5763,540.2581 632.9513,540.2581 Q631.6075,540.2581 630.92,541.3363 Q630.2325,542.3988 630.2325,544.4925 Q630.2325,546.5863 630.92,547.6644 Q631.6075,548.7269 632.9513,548.7269 Q633.5763,548.7269 634.17,548.4613 Q634.7638,548.18 635.3888,547.6019 L635.3888,550.3206 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="114.208" x="646.42" y="549.5267">PayrollDatabase</text><line style="stroke:#181818;stroke-width:0.5;" x1="618.42" x2="762.628" y1="560.68" y2="560.68"></line><line style="stroke:#181818;stroke-width:0.5;" x1="618.42" x2="762.628" y1="568.68" y2="568.68"></line></g><!--class ChangeNameTransaction--><g class="entity" data-entity="ChangeNameTransaction" data-source-line="24" data-uid="ent0009" id="entity_ChangeNameTransaction"><rect fill="#F1F1F1" height="64.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="209.0508" x="7" y="172.75"></rect><ellipse cx="22" cy="188.75" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M24.9688,194.3906 Q24.3906,194.6875 23.75,194.8281 Q23.1094,194.9844 22.4063,194.9844 Q19.9063,194.9844 18.5781,193.3438 Q17.2656,191.6875 17.2656,188.5625 Q17.2656,185.4375 18.5781,183.7813 Q19.9063,182.125 22.4063,182.125 Q23.1094,182.125 23.75,182.2813 Q24.4063,182.4375 24.9688,182.7344 L24.9688,185.4531 Q24.3438,184.875 23.75,184.6094 Q23.1563,184.3281 22.5313,184.3281 Q21.1875,184.3281 20.5,185.4063 Q19.8125,186.4688 19.8125,188.5625 Q19.8125,190.6563 20.5,191.7344 Q21.1875,192.7969 22.5313,192.7969 Q23.1563,192.7969 23.75,192.5313 Q24.3438,192.25 24.9688,191.6719 L24.9688,194.3906 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="177.0508" x="36" y="193.5967">ChangeNameTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="8" x2="215.0508" y1="204.75" y2="204.75"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="15" y="215.3984"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="39.7031" x="27" y="221.7451">name</text><line style="stroke:#181818;stroke-width:0.5;" x1="8" x2="215.0508" y1="229.0469" y2="229.0469"></line></g><!--class ChangeAddressTransaction--><g class="entity" data-entity="ChangeAddressTransaction" data-source-line="29" data-uid="ent0011" id="entity_ChangeAddressTransaction"><rect fill="#F1F1F1" height="64.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="224.0557" x="251.5" y="172.75"></rect><ellipse cx="266.5" cy="188.75" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M269.4688,194.3906 Q268.8906,194.6875 268.25,194.8281 Q267.6094,194.9844 266.9063,194.9844 Q264.4063,194.9844 263.0781,193.3438 Q261.7656,191.6875 261.7656,188.5625 Q261.7656,185.4375 263.0781,183.7813 Q264.4063,182.125 266.9063,182.125 Q267.6094,182.125 268.25,182.2813 Q268.9063,182.4375 269.4688,182.7344 L269.4688,185.4531 Q268.8438,184.875 268.25,184.6094 Q267.6563,184.3281 267.0313,184.3281 Q265.6875,184.3281 265,185.4063 Q264.3125,186.4688 264.3125,188.5625 Q264.3125,190.6563 265,191.7344 Q265.6875,192.7969 267.0313,192.7969 Q267.6563,192.7969 268.25,192.5313 Q268.8438,192.25 269.4688,191.6719 L269.4688,194.3906 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="192.0557" x="280.5" y="193.5967">ChangeAddressTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="252.5" x2="474.5557" y1="204.75" y2="204.75"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="259.5" y="215.3984"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="55.3096" x="271.5" y="221.7451">address</text><line style="stroke:#181818;stroke-width:0.5;" x1="252.5" x2="474.5557" y1="229.0469" y2="229.0469"></line></g><!--class ChangeClassificationTransaction--><g class="entity" data-entity="ChangeClassificationTransaction" data-source-line="34" data-uid="ent0013" id="entity_ChangeClassificationTransaction"><rect fill="#F1F1F1" height="80.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="260.3818" x="715.33" y="164.6"></rect><ellipse cx="730.33" cy="180.6" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M733.2988,186.2406 Q732.7206,186.5375 732.08,186.6781 Q731.4394,186.8344 730.7363,186.8344 Q728.2363,186.8344 726.9081,185.1937 Q725.5956,183.5375 725.5956,180.4125 Q725.5956,177.2875 726.9081,175.6312 Q728.2363,173.975 730.7363,173.975 Q731.4394,173.975 732.08,174.1312 Q732.7363,174.2875 733.2988,174.5844 L733.2988,177.3031 Q732.6738,176.725 732.08,176.4594 Q731.4863,176.1781 730.8613,176.1781 Q729.5175,176.1781 728.83,177.2562 Q728.1425,178.3187 728.1425,180.4125 Q728.1425,182.5062 728.83,183.5844 Q729.5175,184.6469 730.8613,184.6469 Q731.4863,184.6469 732.08,184.3812 Q732.6738,184.1 733.2988,183.5219 L733.2988,186.2406 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="228.3818" x="744.33" y="185.4467">ChangeClassificationTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="716.33" x2="974.7118" y1="196.6" y2="196.6"></line><line style="stroke:#181818;stroke-width:0.5;" x1="716.33" x2="974.7118" y1="204.6" y2="204.6"></line><ellipse cx="726.33" cy="218.2484" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="81.9766" x="735.33" y="221.5951">doChange()</text><ellipse cx="726.33" cy="234.5453" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="126.5469" x="735.33" y="237.892">getClassification()</text></g><!--class ChangeMethodTransaction--><g class="entity" data-entity="ChangeMethodTransaction" data-source-line="40" data-uid="ent0015" id="entity_ChangeMethodTransaction"><rect fill="#F1F1F1" height="80.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="220.2549" x="1790.4" y="164.6"></rect><ellipse cx="1805.4" cy="180.6" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M1808.3688,186.2406 Q1807.7906,186.5375 1807.15,186.6781 Q1806.5094,186.8344 1805.8063,186.8344 Q1803.3063,186.8344 1801.9781,185.1937 Q1800.6656,183.5375 1800.6656,180.4125 Q1800.6656,177.2875 1801.9781,175.6312 Q1803.3063,173.975 1805.8063,173.975 Q1806.5094,173.975 1807.15,174.1312 Q1807.8063,174.2875 1808.3688,174.5844 L1808.3688,177.3031 Q1807.7438,176.725 1807.15,176.4594 Q1806.5563,176.1781 1805.9313,176.1781 Q1804.5875,176.1781 1803.9,177.2562 Q1803.2125,178.3187 1803.2125,180.4125 Q1803.2125,182.5062 1803.9,183.5844 Q1804.5875,184.6469 1805.9313,184.6469 Q1806.5563,184.6469 1807.15,184.3812 Q1807.7438,184.1 1808.3688,183.5219 L1808.3688,186.2406 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="188.2549" x="1819.4" y="185.4467">ChangeMethodTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="1791.4" x2="2009.6549" y1="196.6" y2="196.6"></line><line style="stroke:#181818;stroke-width:0.5;" x1="1791.4" x2="2009.6549" y1="204.6" y2="204.6"></line><ellipse cx="1801.4" cy="218.2484" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="81.9766" x="1810.4" y="221.5951">doChange()</text><ellipse cx="1801.4" cy="234.5453" fill="#84BE84" rx="3" ry="3" style="stroke:#038048;stroke-width:1;"></ellipse><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="86.4199" x="1810.4" y="237.892">getMethod()</text></g><!--class ChangeHourlyTransaction--><g class="entity" data-entity="ChangeHourlyTransaction" data-source-line="46" data-uid="ent0017" id="entity_ChangeHourlyTransaction"><rect fill="#F1F1F1" height="64.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="213.6445" x="586.7" y="15.15"></rect><ellipse cx="601.7" cy="31.15" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M604.6688,36.7906 Q604.0906,37.0875 603.45,37.2281 Q602.8094,37.3844 602.1063,37.3844 Q599.6063,37.3844 598.2781,35.7437 Q596.9656,34.0875 596.9656,30.9625 Q596.9656,27.8375 598.2781,26.1812 Q599.6063,24.525 602.1063,24.525 Q602.8094,24.525 603.45,24.6812 Q604.1063,24.8375 604.6688,25.1344 L604.6688,27.8531 Q604.0438,27.275 603.45,27.0094 Q602.8563,26.7281 602.2313,26.7281 Q600.8875,26.7281 600.2,27.8062 Q599.5125,28.8687 599.5125,30.9625 Q599.5125,33.0562 600.2,34.1344 Q600.8875,35.1969 602.2313,35.1969 Q602.8563,35.1969 603.45,34.9312 Q604.0438,34.65 604.6688,34.0719 L604.6688,36.7906 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="181.6445" x="615.7" y="35.9967">ChangeHourlyTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="587.7" x2="799.3445" y1="47.15" y2="47.15"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="594.7" y="57.7984"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="76.6514" x="606.7" y="64.1451">hourlyRate</text><line style="stroke:#181818;stroke-width:0.5;" x1="587.7" x2="799.3445" y1="71.4469" y2="71.4469"></line></g><!--class ChangeSalariedTransaction--><g class="entity" data-entity="ChangeSalariedTransaction" data-source-line="51" data-uid="ent0019" id="entity_ChangeSalariedTransaction"><rect fill="#F1F1F1" height="64.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="224.8281" x="866.11" y="15.15"></rect><ellipse cx="881.11" cy="31.15" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M884.0788,36.7906 Q883.5006,37.0875 882.86,37.2281 Q882.2194,37.3844 881.5163,37.3844 Q879.0163,37.3844 877.6881,35.7437 Q876.3756,34.0875 876.3756,30.9625 Q876.3756,27.8375 877.6881,26.1812 Q879.0163,24.525 881.5163,24.525 Q882.2194,24.525 882.86,24.6812 Q883.5163,24.8375 884.0788,25.1344 L884.0788,27.8531 Q883.4538,27.275 882.86,27.0094 Q882.2663,26.7281 881.6413,26.7281 Q880.2975,26.7281 879.61,27.8062 Q878.9225,28.8687 878.9225,30.9625 Q878.9225,33.0562 879.61,34.1344 Q880.2975,35.1969 881.6413,35.1969 Q882.2663,35.1969 882.86,34.9312 Q883.4538,34.65 884.0788,34.0719 L884.0788,36.7906 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="192.8281" x="895.11" y="35.9967">ChangeSalariedTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="867.11" x2="1089.9381" y1="47.15" y2="47.15"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="874.11" y="57.7984"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="42.3828" x="886.11" y="64.1451">salary</text><line style="stroke:#181818;stroke-width:0.5;" x1="867.11" x2="1089.9381" y1="71.4469" y2="71.4469"></line></g><!--class ChangeCommissionedTransaction--><g class="entity" data-entity="ChangeCommissionedTransaction" data-source-line="57" data-uid="ent0021" id="entity_ChangeCommissionedTransaction"><rect fill="#F1F1F1" height="80.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="270.6699" x="1150.19" y="7"></rect><ellipse cx="1165.19" cy="23" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M1168.1588,28.6406 Q1167.5806,28.9375 1166.94,29.0781 Q1166.2994,29.2344 1165.5963,29.2344 Q1163.0963,29.2344 1161.7681,27.5938 Q1160.4556,25.9375 1160.4556,22.8125 Q1160.4556,19.6875 1161.7681,18.0313 Q1163.0963,16.375 1165.5963,16.375 Q1166.2994,16.375 1166.94,16.5313 Q1167.5963,16.6875 1168.1588,16.9844 L1168.1588,19.7031 Q1167.5338,19.125 1166.94,18.8594 Q1166.3463,18.5781 1165.7213,18.5781 Q1164.3775,18.5781 1163.69,19.6563 Q1163.0025,20.7188 1163.0025,22.8125 Q1163.0025,24.9063 1163.69,25.9844 Q1164.3775,27.0469 1165.7213,27.0469 Q1166.3463,27.0469 1166.94,26.7813 Q1167.5338,26.5 1168.1588,25.9219 L1168.1588,28.6406 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="238.6699" x="1179.19" y="27.8467">ChangeCommissionedTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="1151.19" x2="1419.8599" y1="39" y2="39"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="1158.19" y="49.6484"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="42.3828" x="1170.19" y="55.9951">salary</text><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="1158.19" y="65.9453"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="115.7529" x="1170.19" y="72.292">commissionRate</text><line style="stroke:#181818;stroke-width:0.5;" x1="1151.19" x2="1419.8599" y1="79.5938" y2="79.5938"></line></g><!--class ChangeHoldTransaction--><g class="entity" data-entity="ChangeHoldTransaction" data-source-line="63" data-uid="ent0023" id="entity_ChangeHoldTransaction"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="199.6172" x="1487.72" y="23.3"></rect><ellipse cx="1502.72" cy="39.3" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M1505.6888,44.9406 Q1505.1106,45.2375 1504.47,45.3781 Q1503.8294,45.5344 1503.1263,45.5344 Q1500.6263,45.5344 1499.2981,43.8937 Q1497.9856,42.2375 1497.9856,39.1125 Q1497.9856,35.9875 1499.2981,34.3312 Q1500.6263,32.675 1503.1263,32.675 Q1503.8294,32.675 1504.47,32.8312 Q1505.1263,32.9875 1505.6888,33.2844 L1505.6888,36.0031 Q1505.0638,35.425 1504.47,35.1594 Q1503.8763,34.8781 1503.2513,34.8781 Q1501.9075,34.8781 1501.22,35.9562 Q1500.5325,37.0187 1500.5325,39.1125 Q1500.5325,41.2062 1501.22,42.2844 Q1501.9075,43.3469 1503.2513,43.3469 Q1503.8763,43.3469 1504.47,43.0812 Q1505.0638,42.8 1505.6888,42.2219 L1505.6888,44.9406 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="167.6172" x="1516.72" y="44.1467">ChangeHoldTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="1488.72" x2="1686.3372" y1="55.3" y2="55.3"></line><line style="stroke:#181818;stroke-width:0.5;" x1="1488.72" x2="1686.3372" y1="63.3" y2="63.3"></line></g><!--class ChangeMailTransaction--><g class="entity" data-entity="ChangeMailTransaction" data-source-line="67" data-uid="ent0025" id="entity_ChangeMailTransaction"><rect fill="#F1F1F1" height="64.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="196.1855" x="1735.43" y="15.15"></rect><ellipse cx="1750.43" cy="31.15" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M1753.3988,36.7906 Q1752.8206,37.0875 1752.18,37.2281 Q1751.5394,37.3844 1750.8363,37.3844 Q1748.3363,37.3844 1747.0081,35.7437 Q1745.6956,34.0875 1745.6956,30.9625 Q1745.6956,27.8375 1747.0081,26.1812 Q1748.3363,24.525 1750.8363,24.525 Q1751.5394,24.525 1752.18,24.6812 Q1752.8363,24.8375 1753.3988,25.1344 L1753.3988,27.8531 Q1752.7738,27.275 1752.18,27.0094 Q1751.5863,26.7281 1750.9613,26.7281 Q1749.6175,26.7281 1748.93,27.8062 Q1748.2425,28.8687 1748.2425,30.9625 Q1748.2425,33.0562 1748.93,34.1344 Q1749.6175,35.1969 1750.9613,35.1969 Q1751.5863,35.1969 1752.18,34.9312 Q1752.7738,34.65 1753.3988,34.0719 L1753.3988,36.7906 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="164.1855" x="1764.43" y="35.9967">ChangeMailTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="1736.43" x2="1930.6155" y1="47.15" y2="47.15"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="1743.43" y="57.7984"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="55.3096" x="1755.43" y="64.1451">address</text><line style="stroke:#181818;stroke-width:0.5;" x1="1736.43" x2="1930.6155" y1="71.4469" y2="71.4469"></line></g><!--class ChangeDirectTransaction--><g class="entity" data-entity="ChangeDirectTransaction" data-source-line="72" data-uid="ent0027" id="entity_ChangeDirectTransaction"><rect fill="#F1F1F1" height="80.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="209.9736" x="1972.54" y="7"></rect><ellipse cx="1987.54" cy="23" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M1990.5088,28.6406 Q1989.9306,28.9375 1989.29,29.0781 Q1988.6494,29.2344 1987.9463,29.2344 Q1985.4463,29.2344 1984.1181,27.5938 Q1982.8056,25.9375 1982.8056,22.8125 Q1982.8056,19.6875 1984.1181,18.0313 Q1985.4463,16.375 1987.9463,16.375 Q1988.6494,16.375 1989.29,16.5313 Q1989.9463,16.6875 1990.5088,16.9844 L1990.5088,19.7031 Q1989.8838,19.125 1989.29,18.8594 Q1988.6963,18.5781 1988.0713,18.5781 Q1986.7275,18.5781 1986.04,19.6563 Q1985.3525,20.7188 1985.3525,22.8125 Q1985.3525,24.9063 1986.04,25.9844 Q1986.7275,27.0469 1988.0713,27.0469 Q1988.6963,27.0469 1989.29,26.7813 Q1989.8838,26.5 1990.5088,25.9219 L1990.5088,28.6406 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="177.9736" x="2001.54" y="27.8467">ChangeDirectTransaction</text><line style="stroke:#181818;stroke-width:0.5;" x1="1973.54" x2="2181.5136" y1="39" y2="39"></line><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="1980.54" y="49.6484"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="34.4463" x="1992.54" y="55.9951">bank</text><rect fill="none" height="6" style="stroke:#C82930;stroke-width:1;" width="6" x="1980.54" y="65.9453"></rect><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="55.7744" x="1992.54" y="72.292">account</text><line style="stroke:#181818;stroke-width:0.5;" x1="1973.54" x2="2181.5136" y1="79.5938" y2="79.5938"></line></g><!--class HourlyClassification--><g class="entity" data-entity="HourlyClassification" data-source-line="77" data-uid="ent0029" id="entity_HourlyClassification"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="170.5303" x="510.26" y="180.89"></rect><ellipse cx="525.26" cy="196.89" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M528.2288,202.5306 Q527.6506,202.8275 527.01,202.9681 Q526.3694,203.1244 525.6663,203.1244 Q523.1663,203.1244 521.8381,201.4838 Q520.5256,199.8275 520.5256,196.7025 Q520.5256,193.5775 521.8381,191.9213 Q523.1663,190.265 525.6663,190.265 Q526.3694,190.265 527.01,190.4213 Q527.6663,190.5775 528.2288,190.8744 L528.2288,193.5931 Q527.6038,193.015 527.01,192.7494 Q526.4163,192.4681 525.7913,192.4681 Q524.4475,192.4681 523.76,193.5463 Q523.0725,194.6088 523.0725,196.7025 Q523.0725,198.7963 523.76,199.8744 Q524.4475,200.9369 525.7913,200.9369 Q526.4163,200.9369 527.01,200.6713 Q527.6038,200.39 528.2288,199.8119 L528.2288,202.5306 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="138.5303" x="539.26" y="201.7367">HourlyClassification</text><line style="stroke:#181818;stroke-width:0.5;" x1="511.26" x2="679.7903" y1="212.89" y2="212.89"></line><line style="stroke:#181818;stroke-width:0.5;" x1="511.26" x2="679.7903" y1="220.89" y2="220.89"></line></g><!--class SalariedClassification--><g class="entity" data-entity="SalariedClassification" data-source-line="80" data-uid="ent0031" id="entity_SalariedClassification"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="181.7139" x="1010.67" y="180.89"></rect><ellipse cx="1025.67" cy="196.89" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M1028.6388,202.5306 Q1028.0606,202.8275 1027.42,202.9681 Q1026.7794,203.1244 1026.0763,203.1244 Q1023.5763,203.1244 1022.2481,201.4838 Q1020.9356,199.8275 1020.9356,196.7025 Q1020.9356,193.5775 1022.2481,191.9213 Q1023.5763,190.265 1026.0763,190.265 Q1026.7794,190.265 1027.42,190.4213 Q1028.0763,190.5775 1028.6388,190.8744 L1028.6388,193.5931 Q1028.0138,193.015 1027.42,192.7494 Q1026.8263,192.4681 1026.2013,192.4681 Q1024.8575,192.4681 1024.17,193.5463 Q1023.4825,194.6088 1023.4825,196.7025 Q1023.4825,198.7963 1024.17,199.8744 Q1024.8575,200.9369 1026.2013,200.9369 Q1026.8263,200.9369 1027.42,200.6713 Q1028.0138,200.39 1028.6388,199.8119 L1028.6388,202.5306 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="149.7139" x="1039.67" y="201.7367">SalariedClassification</text><line style="stroke:#181818;stroke-width:0.5;" x1="1011.67" x2="1191.3839" y1="212.89" y2="212.89"></line><line style="stroke:#181818;stroke-width:0.5;" x1="1011.67" x2="1191.3839" y1="220.89" y2="220.89"></line></g><!--class CommissionedClassification--><g class="entity" data-entity="CommissionedClassification" data-source-line="83" data-uid="ent0033" id="entity_CommissionedClassification"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="227.5557" x="1227.75" y="180.89"></rect><ellipse cx="1242.75" cy="196.89" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M1245.7188,202.5306 Q1245.1406,202.8275 1244.5,202.9681 Q1243.8594,203.1244 1243.1563,203.1244 Q1240.6563,203.1244 1239.3281,201.4838 Q1238.0156,199.8275 1238.0156,196.7025 Q1238.0156,193.5775 1239.3281,191.9213 Q1240.6563,190.265 1243.1563,190.265 Q1243.8594,190.265 1244.5,190.4213 Q1245.1563,190.5775 1245.7188,190.8744 L1245.7188,193.5931 Q1245.0938,193.015 1244.5,192.7494 Q1243.9063,192.4681 1243.2813,192.4681 Q1241.9375,192.4681 1241.25,193.5463 Q1240.5625,194.6088 1240.5625,196.7025 Q1240.5625,198.7963 1241.25,199.8744 Q1241.9375,200.9369 1243.2813,200.9369 Q1243.9063,200.9369 1244.5,200.6713 Q1245.0938,200.39 1245.7188,199.8119 L1245.7188,202.5306 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="195.5557" x="1256.75" y="201.7367">CommissionedClassification</text><line style="stroke:#181818;stroke-width:0.5;" x1="1228.75" x2="1454.3057" y1="212.89" y2="212.89"></line><line style="stroke:#181818;stroke-width:0.5;" x1="1228.75" x2="1454.3057" y1="220.89" y2="220.89"></line></g><!--class HoldMethod--><g class="entity" data-entity="HoldMethod" data-source-line="86" data-uid="ent0035" id="entity_HoldMethod"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="116.376" x="1490.34" y="180.89"></rect><ellipse cx="1505.34" cy="196.89" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M1508.3088,202.5306 Q1507.7306,202.8275 1507.09,202.9681 Q1506.4494,203.1244 1505.7463,203.1244 Q1503.2463,203.1244 1501.9181,201.4838 Q1500.6056,199.8275 1500.6056,196.7025 Q1500.6056,193.5775 1501.9181,191.9213 Q1503.2463,190.265 1505.7463,190.265 Q1506.4494,190.265 1507.09,190.4213 Q1507.7463,190.5775 1508.3088,190.8744 L1508.3088,193.5931 Q1507.6838,193.015 1507.09,192.7494 Q1506.4963,192.4681 1505.8713,192.4681 Q1504.5275,192.4681 1503.84,193.5463 Q1503.1525,194.6088 1503.1525,196.7025 Q1503.1525,198.7963 1503.84,199.8744 Q1504.5275,200.9369 1505.8713,200.9369 Q1506.4963,200.9369 1507.09,200.6713 Q1507.6838,200.39 1508.3088,199.8119 L1508.3088,202.5306 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="84.376" x="1519.34" y="201.7367">HoldMethod</text><line style="stroke:#181818;stroke-width:0.5;" x1="1491.34" x2="1605.716" y1="212.89" y2="212.89"></line><line style="stroke:#181818;stroke-width:0.5;" x1="1491.34" x2="1605.716" y1="220.89" y2="220.89"></line></g><!--class MailMethod--><g class="entity" data-entity="MailMethod" data-source-line="89" data-uid="ent0037" id="entity_MailMethod"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="112.9443" x="1642.05" y="180.89"></rect><ellipse cx="1657.05" cy="196.89" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M1660.0188,202.5306 Q1659.4406,202.8275 1658.8,202.9681 Q1658.1594,203.1244 1657.4563,203.1244 Q1654.9563,203.1244 1653.6281,201.4838 Q1652.3156,199.8275 1652.3156,196.7025 Q1652.3156,193.5775 1653.6281,191.9213 Q1654.9563,190.265 1657.4563,190.265 Q1658.1594,190.265 1658.8,190.4213 Q1659.4563,190.5775 1660.0188,190.8744 L1660.0188,193.5931 Q1659.3938,193.015 1658.8,192.7494 Q1658.2063,192.4681 1657.5813,192.4681 Q1656.2375,192.4681 1655.55,193.5463 Q1654.8625,194.6088 1654.8625,196.7025 Q1654.8625,198.7963 1655.55,199.8744 Q1656.2375,200.9369 1657.5813,200.9369 Q1658.2063,200.9369 1658.8,200.6713 Q1659.3938,200.39 1660.0188,199.8119 L1660.0188,202.5306 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="80.9443" x="1671.05" y="201.7367">MailMethod</text><line style="stroke:#181818;stroke-width:0.5;" x1="1643.05" x2="1753.9943" y1="212.89" y2="212.89"></line><line style="stroke:#181818;stroke-width:0.5;" x1="1643.05" x2="1753.9943" y1="220.89" y2="220.89"></line></g><!--class DirectMethod--><g class="entity" data-entity="DirectMethod" data-source-line="93" data-uid="ent0039" id="entity_DirectMethod"><rect fill="#F1F1F1" height="48" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="126.7324" x="2045.16" y="180.89"></rect><ellipse cx="2060.16" cy="196.89" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1;"></ellipse><path d="M2063.1288,202.5306 Q2062.5506,202.8275 2061.91,202.9681 Q2061.2694,203.1244 2060.5663,203.1244 Q2058.0663,203.1244 2056.7381,201.4838 Q2055.4256,199.8275 2055.4256,196.7025 Q2055.4256,193.5775 2056.7381,191.9213 Q2058.0663,190.265 2060.5663,190.265 Q2061.2694,190.265 2061.91,190.4213 Q2062.5663,190.5775 2063.1288,190.8744 L2063.1288,193.5931 Q2062.5038,193.015 2061.91,192.7494 Q2061.3163,192.4681 2060.6913,192.4681 Q2059.3475,192.4681 2058.66,193.5463 Q2057.9725,194.6088 2057.9725,196.7025 Q2057.9725,198.7963 2058.66,199.8744 Q2059.3475,200.9369 2060.6913,200.9369 Q2061.3163,200.9369 2061.91,200.6713 Q2062.5038,200.39 2063.1288,199.8119 L2063.1288,202.5306 Z " fill="#000000"></path><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="94.7324" x="2074.16" y="201.7367">DirectMethod</text><line style="stroke:#181818;stroke-width:0.5;" x1="2046.16" x2="2170.8924" y1="212.89" y2="212.89"></line><line style="stroke:#181818;stroke-width:0.5;" x1="2046.16" x2="2170.8924" y1="220.89" y2="220.89"></line></g><!--link ChangeEmployeeTransaction to Transaction--><g class="link" data-entity-1="ChangeEmployeeTransaction" data-entity-2="Transaction" data-source-line="10" data-uid="lnk4" id="link_ChangeEmployeeTransaction_Transaction"><path codeline="10" d="M461.95,419.41 C432.2,451.29 406.2007,479.1501 380.2207,506.9901" fill="none" id="ChangeEmployeeTransaction-to-Transaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="367.94,520.15,384.6074,511.0836,375.8341,502.8965,367.94,520.15" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="48.915" x="434.53" y="462.1469">inherits</text></g><!--link ChangeEmployeeTransaction to Employee--><g class="link" data-entity-1="ChangeEmployeeTransaction" data-entity-2="Employee" data-source-line="18" data-uid="lnk6" id="link_ChangeEmployeeTransaction_Employee"><path codeline="18" d="M506.53,419.41 C506.53,442.85 506.53,465.23 506.53,489.69" fill="none" id="ChangeEmployeeTransaction-to-Employee" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="506.53,495.69,510.53,486.69,506.53,490.69,502.53,486.69,506.53,495.69" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="83.9668" x="507.53" y="462.1469">«associates»</text></g><!--link ChangeEmployeeTransaction to PayrollDatabase--><g class="link" data-entity-1="ChangeEmployeeTransaction" data-entity-2="PayrollDatabase" data-source-line="22" data-uid="lnk8" id="link_ChangeEmployeeTransaction_PayrollDatabase"><path codeline="22" d="M566.73,419.5 C577.9,429.01 589.27,439.14 599.53,449.08 C626.02,474.77 649.9544,502.3461 667.7444,523.7461" fill="none" id="ChangeEmployeeTransaction-to-PayrollDatabase" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="671.58,528.36,668.9026,518.8821,668.3837,524.5151,662.7507,523.9962,671.58,528.36" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="83.9668" x="616.53" y="462.1469">«associates»</text></g><!--link ChangeNameTransaction to ChangeEmployeeTransaction--><g class="link" data-entity-1="ChangeNameTransaction" data-entity-2="ChangeEmployeeTransaction" data-source-line="27" data-uid="lnk10" id="link_ChangeNameTransaction_ChangeEmployeeTransaction"><path codeline="27" d="M187.69,237.47 C245.3,261.35 308.7819,287.6676 374.2819,314.8176" fill="none" id="ChangeNameTransaction-to-ChangeEmployeeTransaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="390.91,321.71,376.5793,309.2749,371.9844,320.3603,390.91,321.71" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="48.915" x="310.53" y="288.2569">inherits</text></g><!--link ChangeAddressTransaction to ChangeEmployeeTransaction--><g class="link" data-entity-1="ChangeAddressTransaction" data-entity-2="ChangeEmployeeTransaction" data-source-line="32" data-uid="lnk12" id="link_ChangeAddressTransaction_ChangeEmployeeTransaction"><path codeline="32" d="M391.1,237.47 C411.96,261.35 429.12,281.0022 452.83,308.1522" fill="none" id="ChangeAddressTransaction-to-ChangeEmployeeTransaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="464.67,321.71,457.3493,304.2055,448.3107,312.0988,464.67,321.71" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="48.915" x="436.53" y="288.2569">inherits</text></g><!--link ChangeClassificationTransaction to ChangeEmployeeTransaction--><g class="link" data-entity-1="ChangeClassificationTransaction" data-entity-2="ChangeEmployeeTransaction" data-source-line="38" data-uid="lnk14" id="link_ChangeClassificationTransaction_ChangeEmployeeTransaction"><path codeline="38" d="M763.46,245.53 C715.94,268.48 672.0087,289.712 621.8587,313.932" fill="none" id="ChangeClassificationTransaction-to-ChangeEmployeeTransaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="605.65,321.76,624.468,319.3349,619.2494,308.5291,605.65,321.76" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="48.915" x="697.53" y="288.2569">inherits</text></g><!--link ChangeMethodTransaction to ChangeEmployeeTransaction--><g class="link" data-entity-1="ChangeMethodTransaction" data-entity-2="ChangeEmployeeTransaction" data-source-line="44" data-uid="lnk16" id="link_ChangeMethodTransaction_ChangeEmployeeTransaction"><path codeline="44" d="M1790.22,241.26 C1784.26,242.7 1778.34,244.03 1772.53,245.19 C1356.23,328.68 869.196,356.2508 643.486,365.1508" fill="none" id="ChangeMethodTransaction-to-ChangeEmployeeTransaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="625.5,365.86,643.7224,371.1461,643.2496,359.1554,625.5,365.86" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="48.915" x="1603.53" y="288.2569">inherits</text></g><!--link ChangeHourlyTransaction to ChangeClassificationTransaction--><g class="link" data-entity-1="ChangeHourlyTransaction" data-entity-2="ChangeClassificationTransaction" data-source-line="49" data-uid="lnk18" id="link_ChangeHourlyTransaction_ChangeClassificationTransaction"><path codeline="49" d="M724.28,79.79 C748.05,104.12 768.5203,125.0755 794.1203,151.2755" fill="none" id="ChangeHourlyTransaction-to-ChangeClassificationTransaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="806.7,164.15,798.4118,147.0823,789.8289,155.4687,806.7,164.15" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="48.915" x="775.53" y="130.6669">inherits</text></g><!--link ChangeSalariedTransaction to ChangeClassificationTransaction--><g class="link" data-entity-1="ChangeSalariedTransaction" data-entity-2="ChangeClassificationTransaction" data-source-line="54" data-uid="lnk20" id="link_ChangeSalariedTransaction_ChangeClassificationTransaction"><path codeline="54" d="M951.61,79.79 C930.81,104.12 913.584,124.2661 891.194,150.4661" fill="none" id="ChangeSalariedTransaction-to-ChangeClassificationTransaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="879.5,164.15,895.7553,154.3641,886.6327,146.5681,879.5,164.15" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="48.915" x="917.53" y="130.6669">inherits</text></g><!--link ChangeCommissionedTransaction to ChangeClassificationTransaction--><g class="link" data-entity-1="ChangeCommissionedTransaction" data-entity-2="ChangeClassificationTransaction" data-source-line="61" data-uid="lnk22" id="link_ChangeCommissionedTransaction_ChangeClassificationTransaction"><path codeline="61" d="M1217.76,88.05 C1188.06,104.22 1152.32,122.02 1118.53,134.6 C1064.98,154.52 1048.92,150.6 993.53,164.6 C987.73,166.06 999.2383,163.1184 993.2583,164.6484" fill="none" id="ChangeCommissionedTransaction-to-ChangeClassificationTransaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="975.82,169.11,994.7455,170.4611,991.7711,158.8356,975.82,169.11" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="48.915" x="1157.53" y="130.6669">inherits</text></g><!--link ChangeHoldTransaction to ChangeMethodTransaction--><g class="link" data-entity-1="ChangeHoldTransaction" data-entity-2="ChangeMethodTransaction" data-source-line="65" data-uid="lnk24" id="link_ChangeHoldTransaction_ChangeMethodTransaction"><path codeline="65" d="M1614.35,71.69 C1637.12,90.63 1671.3,116.98 1704.53,134.6 C1720.67,143.16 1737.681,149.9287 1772.931,162.0687" fill="none" id="ChangeHoldTransaction-to-ChangeMethodTransaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="1789.95,167.93,1774.8848,156.3957,1770.9773,167.7417,1789.95,167.93" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="48.915" x="1705.53" y="130.6669">inherits</text></g><!--link ChangeMailTransaction to ChangeMethodTransaction--><g class="link" data-entity-1="ChangeMailTransaction" data-entity-2="ChangeMethodTransaction" data-source-line="70" data-uid="lnk26" id="link_ChangeMailTransaction_ChangeMethodTransaction"><path codeline="70" d="M1847.08,79.79 C1857.56,104.12 1865.012,121.4172 1876.292,147.6172" fill="none" id="ChangeMailTransaction-to-ChangeMethodTransaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="1883.41,164.15,1881.803,145.2445,1870.7811,149.9898,1883.41,164.15" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="48.915" x="1870.53" y="130.6669">inherits</text></g><!--link ChangeDirectTransaction to ChangeMethodTransaction--><g class="link" data-entity-1="ChangeDirectTransaction" data-entity-2="ChangeMethodTransaction" data-source-line="76" data-uid="lnk28" id="link_ChangeDirectTransaction_ChangeMethodTransaction"><path codeline="76" d="M2032.4,87.97 C2005.77,111.38 1985.6996,129.0264 1959.0896,152.4164" fill="none" id="ChangeDirectTransaction-to-ChangeMethodTransaction" style="stroke:#181818;stroke-width:1;"></path><polygon fill="none" points="1945.57,164.3,1963.0508,156.9229,1955.1284,147.9098,1945.57,164.3" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="48.915" x="1995.53" y="130.6669">inherits</text></g><!--link ChangeHourlyTransaction to HourlyClassification--><g class="link" data-entity-1="ChangeHourlyTransaction" data-entity-2="HourlyClassification" data-source-line="79" data-uid="lnk30" id="link_ChangeHourlyTransaction_HourlyClassification"><path codeline="79" d="M673.69,79.79 C654.9,109.62 630.3082,148.6734 613.4182,175.4834" fill="none" id="ChangeHourlyTransaction-to-HourlyClassification" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="610.22,180.56,618.4017,175.0773,612.8852,176.3295,611.6329,170.813,610.22,180.56" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="64.2319" x="648.53" y="130.6669">«creates»</text></g><!--link ChangeSalariedTransaction to SalariedClassification--><g class="link" data-entity-1="ChangeSalariedTransaction" data-entity-2="SalariedClassification" data-source-line="82" data-uid="lnk32" id="link_ChangeSalariedTransaction_SalariedClassification"><path codeline="82" d="M1003.42,79.79 C1027,109.62 1058.1584,149.0436 1079.3584,175.8536" fill="none" id="ChangeSalariedTransaction-to-SalariedClassification" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="1083.08,180.56,1080.6352,171.0194,1079.9787,176.638,1074.3601,175.9815,1083.08,180.56" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="64.2319" x="1045.53" y="130.6669">«creates»</text></g><!--link ChangeCommissionedTransaction to CommissionedClassification--><g class="link" data-entity-1="ChangeCommissionedTransaction" data-entity-2="CommissionedClassification" data-source-line="85" data-uid="lnk34" id="link_ChangeCommissionedTransaction_CommissionedClassification"><path codeline="85" d="M1299.8,87.97 C1310.37,117.32 1322.3574,150.6448 1331.1574,175.0848" fill="none" id="ChangeCommissionedTransaction-to-CommissionedClassification" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="1333.19,180.73,1333.9045,170.9071,1331.4961,176.0257,1326.3776,173.6173,1333.19,180.73" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="64.2319" x="1316.53" y="130.6669">«creates»</text></g><!--link ChangeHoldTransaction to HoldMethod--><g class="link" data-entity-1="ChangeHoldTransaction" data-entity-2="HoldMethod" data-source-line="88" data-uid="lnk36" id="link_ChangeHoldTransaction_HoldMethod"><path codeline="88" d="M1568.85,71.8 C1559.9,84.56 1550.14,101.07 1545.53,117.6 C1539.72,138.39 1540.5212,157.1632 1543.1012,174.7932" fill="none" id="ChangeHoldTransaction-to-HoldMethod" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="1543.97,180.73,1546.6247,171.2457,1543.246,175.7827,1538.709,172.404,1543.97,180.73" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="64.2319" x="1546.53" y="130.6669">«creates»</text></g><!--link ChangeMailTransaction to MailMethod--><g class="link" data-entity-1="ChangeMailTransaction" data-entity-2="MailMethod" data-source-line="91" data-uid="lnk38" id="link_ChangeMailTransaction_MailMethod"><path codeline="91" d="M1806.21,79.79 C1780.32,109.62 1745.962,149.2179 1722.702,176.0279" fill="none" id="ChangeMailTransaction-to-MailMethod" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="1718.77,180.56,1727.6893,176.3832,1722.0466,176.7833,1721.6466,171.1406,1718.77,180.56" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="64.2319" x="1771.53" y="130.6669">«creates»</text></g><!--link ChangeDirectTransaction to DirectMethod--><g class="link" data-entity-1="ChangeDirectTransaction" data-entity-2="DirectMethod" data-source-line="95" data-uid="lnk40" id="link_ChangeDirectTransaction_DirectMethod"><path codeline="95" d="M2085.43,87.97 C2091.28,117.32 2097.8675,150.4057 2102.7375,174.8457" fill="none" id="ChangeDirectTransaction-to-DirectMethod" style="stroke:#181818;stroke-width:1;"></path><polygon fill="#181818" points="2103.91,180.73,2106.0741,171.1218,2102.9329,175.8264,2098.2283,172.6852,2103.91,180.73" style="stroke:#181818;stroke-width:1;"></polygon><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="64.2319" x="2095.53" y="130.6669">«creates»</text></g><!--SRC=[fLJTJiCW6BtlK_HIO_O2oq9YDfDveJ7g2toZk18fBC0I6_NTBMNjIldOJ-qTSBvpJW-dfGACoTyrI0FKSYNpxonldhkSVJ6wj-pcDllDCjh2bYN8BNkeTaBLZCL3ivnLkySY8l3hGldvbZ5DDPlzaC3GFEUoP9fRq_dendglXjbdg8vIpVg-A3GpPhYrTCFyWrDmlCEJ9sPBLPmrHexAytonQDWKvM2P8QIpzWArLaAimC86Z7DuZd8yaMBsBEuriU1bizzBZK5jf6aNSS0UUuWGamD_r2iYq8cYuILXnHpqo6ziaQljZANf9lhpLRdKLrIiU7oYZxNQQr5ZTrEs9wzDUthL63nGJKUKqdu30Pgp0bCtxgpkbJ7erTfXGLHLyMP8oPC6_8Bsu22F5CU_KbahCJ9qZ5-aPE8-98i7N5poAOvnayHMN3DgCRaDoCzEcLArbxPNZeSkrVRIlgLXy46ASOa9FkJ-eLIpmm_KitTDJFBZLIMfGKnZsAkaJhfyv1G1fkUAvOCzsJOo168yhZCHJrmaCWI6F0SYNu682ci62S41tHy0]--></g></svg></p><p>更改雇员属性的抽象类ChangeEmployeeTransaction首先根据雇员编号查找雇员记录，如果找到则进行具体的更改，具体更改需要在派生类中改写doChange()函数实现。<br>
class ChangeEmployeeTransaction : public Transaction {<br>
int empId;<br>
public:<br>
ChangeEmployeeTransaction(int empId)<br>
: empId(empId)<br>
{}<br>
void execute(){<br>
Employee *e=PayrollDatabase::getEmployee(empId);<br>
if(e)<br>
doChange(e);<br>
else<br>
throw("No such employee");<br>
}<br>
virtual void doChange(Employee *e) = 0;<br>
};</p>
<p>下面是针对更改雇员名字的操作进行的测试。<br>
void testChangeName() {<br>
int empId = 1007;<br>
string name = "Bill";<br>
string newName = "Bob";<br>
AddSalariedEmployeeTransaction<br>
t(empId,name,"Address",3000.0);<br>
t.execute();<br>
Employee *e = PayrollDatabase::getEmployee(empId);<br>
assert(e);<br>
assert(e-&gt;getName() == name);<br>
ChangeNameTransaction cnt(empId, newName);<br>
cnt.execute();<br>
Employee *e1 = PayrollDatabase::getEmployee(empId);<br>
assert(e1);<br>
assert(e1-&gt;getName() == newName);<br>
}</p>
<p>对雇员的具体更改是通过定义ChangeEmployeeTransaction的派生类并改写doChange()函数实现的。<br>
class ChangeNameTransaction<br>
: public ChangeEmployeeTransaction {<br>
string name;<br>
public:<br>
ChangeNameTransaction(int empId, string name)<br>
: ChangeEmployeeTransaction(empId), name(name)<br>
{}<br>
void doChange(Employee *e) {<br>
e-&gt;setName(name);<br>
}<br>
};<br>
更改雇员地址的功能作为练习，注意先编写测试。</p>
<p>雇员的薪金类型也是可以更改的，比如从月薪雇员更改为钟点工，下面的测试就反映了这种情况。<br>
void testChangeHourly() {<br>
int empId = 1009;<br>
AddSalariedEmployeeTransaction<br>
t(empId,"Bill","Home",3000.0);<br>
t.execute();<br>
double hourlyRate = 8.0;<br>
ChangeHourlyTransaction cht(empId, hourlyRate);<br>
cht.execute();<br>
Employee *e=PayrollDatabase::getEmployee(empId);<br>
assert(e);<br>
PaymentClassification *pc = e-&gt;getClassification();<br>
assert(pc);<br>
HourlyClassification *hc =<br>
dynamic_cast&lt;HourlyClassification *&gt;(pc);<br>
assert(hc);<br>
assert(fabs(hc-&gt;getHourlyRate() - hourlyRate)&lt;0.001);<br>
}</p>
<p>薪金类型有三种，相应的更改操作也有三种，作为对三种方式的抽象ChangeClassificationTransaction类实现了对薪金类型的修改。<br>
class ChangeClassificationTransaction<br>
: public ChangeEmployeeTransaction {<br>
public:<br>
ChangeClassificationTransaction (int empId)<br>
: ChangeEmployeeTransaction(empId)<br>
{}<br>
void doChange(Employee *e) {<br>
delete e-&gt;getClassification();<br>
e-&gt;setClassification(getClassification());<br>
}<br>
virtual PaymentClassification *getClassification() = 0;<br>
};</p>
<p>具体薪金类型要在派生类中改写虚函数getClassification()实现，下面是更改小时工资的操作，更改月薪和更改酬金都留作练习。<br>
class ChangeHourlyTransaction<br>
: public ChangeClassificationTransaction {<br>
double hourlyRate;<br>
public:<br>
ChangeHourlyTransaction(int empId,<br>
double hourlyRate)<br>
: ChangeClassificationTransaction(empId)<br>
, hourlyRate(hourlyRate)<br>
{}<br>
PaymentClassification *getClassification() {<br>
return new HourlyClassification(hourlyRate);<br>
}<br>
};</p>
<p>薪水的支付方式也是可以更改的。比如从持有支票更改为邮寄支票，请看下面的测试。<br>
void testChangeMail() {<br>
int empId = 1013;<br>
AddSalariedEmployeeTransaction<br>
t(empId,"Bill","Home",3000.0);<br>
t.execute();<br>
string address = "Mail address";<br>
ChangeMailTransaction cmt(empId, address);<br>
cmt.execute();<br>
Employee *e=PayrollDatabase::getEmployee(empId);<br>
assert(e);<br>
PaymentMethod *pm = e-&gt;getMethod();<br>
assert(pm);<br>
MailMethod *mm =<br>
dynamic_cast&lt;MailMethod *&gt;(pm);<br>
assert(mm);<br>
assert(mm-&gt;getAddress() == address);<br>
}</p>
<p>更改薪水的支付方式的设计总体上与上述的更改薪金类型相似。对三种具体更改操作进行抽象，在ChangeMethodTransaction类中，让抽象方法getMethod()返回将要更改的支付方式。<br>
class ChangeMethodTransaction<br>
: public ChangeEmployeeTransaction {<br>
public:<br>
ChangeMethodTransaction(int empId)<br>
: ChangeEmployeeTransaction(empId)<br>
{}<br>
void doChange(Employee *e) {<br>
delete e-&gt;getMethod();<br>
e-&gt;setMethod(getMethod());<br>
}<br>
virtual PaymentMethod *getMethod() = 0;<br>
};</p>
<p>而具体的支付方式通过在派生类中改写getMethod()函数实现。三个派生类的实现是类似的，下面是更改为邮寄支票的操作，另外两个作为练习。<br>
class ChangeMailTransaction<br>
: public ChangeMethodTransaction {<br>
string address;<br>
public:<br>
ChangeMailTransaction(int empId, string address)<br>
: ChangeMethodTransaction(empId), address(address)<br>
{}<br>
PaymentMethod *getMethod() {<br>
return new MailMethod(address);<br>
}<br>
};</p>
<h2 id="7支付薪水">7.支付薪水 </h2>
<p>准备好了么？发薪日到了！每个月的发薪日都要运行薪水支付系统，为每个雇员支付薪水。<br>
首要的问题是如何计算薪金。显然，这取决于一个雇员计算薪金的方式。月薪雇员的情况最简单。<br>
void testPaydaySalaried() {<br>
int empId = 1016;<br>
double salary = 3456.78;<br>
AddSalariedEmployeeTransaction<br>
t(empId,"Bill","Home",salary);<br>
t.execute();<br>
PaydayTransaction pt;<br>
pt.execute();<br>
Paycheck *check = pt.getPaycheck(empId);<br>
assert(check);<br>
assert(fabs(check-&gt;getAmount() - salary)&lt;0.001);<br>
assert(check-&gt;getDisposition() == "Hold");<br>
}</p>
<p>支付薪水操作保存了每个雇员的薪金支票，操作过程是为每个雇员创建支付薪金的支票，然后让每个Employee对象计算薪金并填写到支票上。<br>
class PaydayTransaction : public Transaction {<br>
map&lt;int, Paycheck *&gt; itsPaychecks;	//雇员的薪金支票<br>
public:<br>
~PaydayTransaction();<br>
void execute() {<br>
PayrollDatabase::forEachEmployee(*this); //函数对象<br>
}<br>
void operator()(Employee *e) {	//实现函数对象<br>
Paycheck *paycheck = new Paycheck();<br>
itsPaychecks[e-&gt;getEmpId()] = paycheck;<br>
e-&gt;payday(paycheck);	//计算并填写支票<br>
}<br>
Paycheck *getPaycheck(int empId) {<br>
return itsPaychecks[empId];<br>
}<br>
};</p>
<p>为了能够遍历并操作数据库中的所有Employee对象，给PayrollDatabase类增加模板函数，并且用封装了具体操作的函数对象作为参数。<br>
template <typename func=""><br>
static void forEachEmployee(Func&amp; func) {<br>
map&lt;int, Employee *&gt;::iterator it = employees.begin();<br>
for(; it!=employees.end(); ++it)<br>
func(it-&gt;second);<br>
}</typename></p>
<p>雇员类Employee中根据其薪金类型itsClassification计算薪金并填写支票的数额，然后根据其支付方式itsMethod进行支付。<br>
void payday(Paycheck *paycheck) {<br>
double payAmount =<br>
itsClassification-&gt;calculatePay();<br>
paycheck-&gt;setAmount(payAmount);<br>
itsMethod-&gt;pay(paycheck);<br>
}</p>
<p>为PaymentClassification类添加纯虚函数calculatePay()。然后，在派生类中改写以实现具体条件下计算薪金。月薪的计算非常简单。<br>
double SalariedClassification::calculatePay() {<br>
return itsSalary;<br>
}<br>
如果是月薪加酬金，则要查看所有的销售凭条并计算酬金。<br>
double CommissionedClassification::calculatePay() {<br>
double totalAmount = 0;<br>
for(int i=0; i&lt;31; i++) {<br>
SalesReceipt <em>sr = itsSalesReceipts[i];<br>
totalAmount += (sr ? sr-&gt;getAmount() : 0);<br>
}<br>
return itsSalary + totalAmount</em>itsCommissionRate;<br>
}<br>
计算钟点工的薪金时要查看所有的时间卡，注意每天超过8小时部分要按小时工资的1.5倍进行支付，具体实现留作练习。</p>
<p>由于支付方式不同，为PaymentMethod添加纯虚函数pay()，并在各个派生类中实现具体支付，当前程序中仅设置了支票的处理方法(disposition)。如持有支票支付方式实现如下，其他支付方式作为练习。<br>
void HoldMethod::pay(Paycheck *paycheck) {<br>
paycheck-&gt;setDisposition("Hold");<br>
}</p>
<p>至此，薪水支付系统中各个操作均已实现，作为练习请编写系统的主程序。主程序的总体思路是重复读入操作命令，分析操作命令并创建对应的操作对象，然后执行该操作，直到处理完所有命令为止。</p>
<h2 id="小结">小结 </h2>
<p>本案例实现了一个比较复杂的薪水支付系统，综合展现了面向对象的设计方法。你可能在某本教科书上看到过其他的薪水支付系统，比较典型的情形就是通过继承将雇员分类，然后利用多态的方法计算薪水。你可能已经发现，本案例中使用的不是用继承而是组合的方法，而且可以看出这种方式更加灵活，甚至可以更改雇员计算薪水的方式。<br>
ASD中的薪水支付案例要更复杂一些，支付薪水的时间周期是不同的，雇员可以加入协会，要在薪水中扣除协会的服务费等，其源代码可以在<a href="http://www.objectmentor.com/ppp%E4%B8%8B%E8%BD%BD%E3%80%82%E5%A6%82%E6%9E%9C%E6%83%B3%E4%B8%8EBob%E5%A4%A7%E5%8F%94%E4%BA%B2%E5%AF%86%E6%8E%A5%E8%A7%A6%EF%BC%8C%E5%AD%A6%E4%B9%A0%E5%85%B6%E4%BC%98%E7%A7%80%E7%9A%84%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E6%80%9D%E6%83%B3%EF%BC%8C%E8%AF%B7%E7%9B%B4%E6%8E%A5%E9%98%85%E8%AF%BBASD%E6%88%96%E5%85%B6%E4%B8%AD%E6%96%87%E7%89%88%E3%80%82">http://www.objectmentor.com/ppp下载。如果想与Bob大叔亲密接触，学习其优秀的面向对象思想，请直接阅读ASD或其中文版。</a></p>

      </div>
      
      
    
    
    
    
    
    
  
    </body></html>